|
18 | 18 | | [JsonTrait](#jsontrait) | Assert JSON responses with path and schema checks. | |
19 | 19 | | [KeyboardTrait](#keyboardtrait) | Simulate keyboard interactions in Drupal browser testing. | |
20 | 20 | | [LinkTrait](#linktrait) | Verify link elements with attribute and content assertions. | |
21 | | -| [MetatagTrait](#metatagtrait) | Assert `<meta>` tags in page markup. | |
| 21 | +| [MetatagTrait](#metatagtrait) | Assert `<meta>` tags and head/SEO markup in page markup. | |
22 | 22 | | [ModalTrait](#modaltrait) | Interact with and assert modals. | |
23 | 23 | | [PathTrait](#pathtrait) | Navigate and verify paths with URL validation. | |
24 | 24 | | [ResponseTrait](#responsetrait) | Verify HTTP responses with status code and header checks. | |
@@ -2154,9 +2154,12 @@ Then the link "Return to site content" should not be an absolute link |
2154 | 2154 |
|
2155 | 2155 | [Source](src/MetatagTrait.php), [Example](tests/behat/features/metatag.feature) |
2156 | 2156 |
|
2157 | | -> Assert `<meta>` tags in page markup. |
| 2157 | +> Assert `<meta>` tags and head/SEO markup in page markup. |
2158 | 2158 | > - Assert presence and content of meta tags with proper attribute handling. |
2159 | 2159 | > - Verify meta tag content is free of HTML markup. |
| 2160 | +> - Assert canonical URL, robots directives and indexability. |
| 2161 | +> - Assert hreflang alternates are valid and reciprocal. |
| 2162 | +> - Assert Open Graph and Twitter Card completeness. |
2160 | 2163 |
|
2161 | 2164 |
|
2162 | 2165 | <details> |
@@ -2206,6 +2209,196 @@ Then the "description" meta tag should not contain any HTML tags |
2206 | 2209 |
|
2207 | 2210 | </details> |
2208 | 2211 |
|
| 2212 | +<details> |
| 2213 | + <summary><code>@Then the canonical URL should be :url</code></summary> |
| 2214 | + |
| 2215 | +<br/> |
| 2216 | +Assert the canonical URL equals a value |
| 2217 | +<br/><br/> |
| 2218 | + |
| 2219 | +```gherkin |
| 2220 | +Then the canonical URL should be "https://example.com/about" |
| 2221 | +Then the canonical URL should be "/about" |
| 2222 | +
|
| 2223 | +``` |
| 2224 | + |
| 2225 | +</details> |
| 2226 | + |
| 2227 | +<details> |
| 2228 | + <summary><code>@Then the canonical URL should exist</code></summary> |
| 2229 | + |
| 2230 | +<br/> |
| 2231 | +Assert the canonical URL is present |
| 2232 | +<br/><br/> |
| 2233 | + |
| 2234 | +```gherkin |
| 2235 | +Then the canonical URL should exist |
| 2236 | +
|
| 2237 | +``` |
| 2238 | + |
| 2239 | +</details> |
| 2240 | + |
| 2241 | +<details> |
| 2242 | + <summary><code>@Then the canonical URL should not exist</code></summary> |
| 2243 | + |
| 2244 | +<br/> |
| 2245 | +Assert the canonical URL is absent |
| 2246 | +<br/><br/> |
| 2247 | + |
| 2248 | +```gherkin |
| 2249 | +Then the canonical URL should not exist |
| 2250 | +
|
| 2251 | +``` |
| 2252 | + |
| 2253 | +</details> |
| 2254 | + |
| 2255 | +<details> |
| 2256 | + <summary><code>@Then the page should be indexable</code></summary> |
| 2257 | + |
| 2258 | +<br/> |
| 2259 | +Assert the page is indexable |
| 2260 | +<br/><br/> |
| 2261 | + |
| 2262 | +```gherkin |
| 2263 | +Then the page should be indexable |
| 2264 | +
|
| 2265 | +``` |
| 2266 | + |
| 2267 | +</details> |
| 2268 | + |
| 2269 | +<details> |
| 2270 | + <summary><code>@Then the page should not be indexable</code></summary> |
| 2271 | + |
| 2272 | +<br/> |
| 2273 | +Assert the page is not indexable |
| 2274 | +<br/><br/> |
| 2275 | + |
| 2276 | +```gherkin |
| 2277 | +Then the page should not be indexable |
| 2278 | +
|
| 2279 | +``` |
| 2280 | + |
| 2281 | +</details> |
| 2282 | + |
| 2283 | +<details> |
| 2284 | + <summary><code>@Then the meta robots should include :directive</code></summary> |
| 2285 | + |
| 2286 | +<br/> |
| 2287 | +Assert the robots meta tag includes a directive |
| 2288 | +<br/><br/> |
| 2289 | + |
| 2290 | +```gherkin |
| 2291 | +Then the meta robots should include "noindex" |
| 2292 | +Then the meta robots should include "nofollow" |
| 2293 | +
|
| 2294 | +``` |
| 2295 | + |
| 2296 | +</details> |
| 2297 | + |
| 2298 | +<details> |
| 2299 | + <summary><code>@Then the meta robots should not include :directive</code></summary> |
| 2300 | + |
| 2301 | +<br/> |
| 2302 | +Assert the robots meta tag does not include a directive |
| 2303 | +<br/><br/> |
| 2304 | + |
| 2305 | +```gherkin |
| 2306 | +Then the meta robots should not include "noindex" |
| 2307 | +Then the meta robots should not include "nofollow" |
| 2308 | +
|
| 2309 | +``` |
| 2310 | + |
| 2311 | +</details> |
| 2312 | + |
| 2313 | +<details> |
| 2314 | + <summary><code>@Then the hreflang alternates should be valid</code></summary> |
| 2315 | + |
| 2316 | +<br/> |
| 2317 | +Assert hreflang alternates are valid |
| 2318 | +<br/><br/> |
| 2319 | + |
| 2320 | +```gherkin |
| 2321 | +Then the hreflang alternates should be valid |
| 2322 | +
|
| 2323 | +``` |
| 2324 | + |
| 2325 | +</details> |
| 2326 | + |
| 2327 | +<details> |
| 2328 | + <summary><code>@Then the hreflang alternates should have reciprocal return links</code></summary> |
| 2329 | + |
| 2330 | +<br/> |
| 2331 | +Assert hreflang alternates have reciprocal return links |
| 2332 | +<br/><br/> |
| 2333 | + |
| 2334 | +```gherkin |
| 2335 | +Then the hreflang alternates should have reciprocal return links |
| 2336 | +
|
| 2337 | +``` |
| 2338 | + |
| 2339 | +</details> |
| 2340 | + |
| 2341 | +<details> |
| 2342 | + <summary><code>@Then the Open Graph tags should be valid</code></summary> |
| 2343 | + |
| 2344 | +<br/> |
| 2345 | +Assert the required Open Graph meta tags are present and non-empty |
| 2346 | +<br/><br/> |
| 2347 | + |
| 2348 | +```gherkin |
| 2349 | +Then the Open Graph tags should be valid |
| 2350 | +
|
| 2351 | +``` |
| 2352 | + |
| 2353 | +</details> |
| 2354 | + |
| 2355 | +<details> |
| 2356 | + <summary><code>@Then the following Open Graph tags should exist:</code></summary> |
| 2357 | + |
| 2358 | +<br/> |
| 2359 | +Assert the listed Open Graph meta tags are present and non-empty |
| 2360 | +<br/><br/> |
| 2361 | + |
| 2362 | +```gherkin |
| 2363 | +Then the following Open Graph tags should exist: |
| 2364 | + | og:title | |
| 2365 | + | og:image | |
| 2366 | + | og:url | |
| 2367 | +
|
| 2368 | +``` |
| 2369 | + |
| 2370 | +</details> |
| 2371 | + |
| 2372 | +<details> |
| 2373 | + <summary><code>@Then the Twitter Card tags should be valid</code></summary> |
| 2374 | + |
| 2375 | +<br/> |
| 2376 | +Assert the required Twitter Card meta tags are present and non-empty |
| 2377 | +<br/><br/> |
| 2378 | + |
| 2379 | +```gherkin |
| 2380 | +Then the Twitter Card tags should be valid |
| 2381 | +
|
| 2382 | +``` |
| 2383 | + |
| 2384 | +</details> |
| 2385 | + |
| 2386 | +<details> |
| 2387 | + <summary><code>@Then the following Twitter Card tags should exist:</code></summary> |
| 2388 | + |
| 2389 | +<br/> |
| 2390 | +Assert the listed Twitter Card meta tags are present and non-empty |
| 2391 | +<br/><br/> |
| 2392 | + |
| 2393 | +```gherkin |
| 2394 | +Then the following Twitter Card tags should exist: |
| 2395 | + | twitter:card | |
| 2396 | + | twitter:title | |
| 2397 | +
|
| 2398 | +``` |
| 2399 | + |
| 2400 | +</details> |
| 2401 | + |
2209 | 2402 | ## ModalTrait |
2210 | 2403 |
|
2211 | 2404 | [Source](src/ModalTrait.php), [Example](tests/behat/features/modal.feature) |
|
0 commit comments