- Issue created by @aangel
Specify the key name, the key value and the content.
Do this for both Cypress and Playwright.
checkMetaContentByProperty: async ([response, key, value, content]) => {
let jsonContent = JSON.parse(await response.text());
for (const meta_elem of jsonContent.metatags.meta) {
if (meta_elem[key] === value) {
expect(meta_elem['content']).toEqual(content);
}
}
},
h/t Petar Basic of Drunomics:
https://github.com/drunomics/playwright-drupal-starter/blob/main/tests/playwright/tests/helpers/test-methods.js
Active
Code