cypresssitemaplibxml-js

Cypress.io - sitemap.xml validation test


:) I chose for automated testing a tool Cypress.io. I need some tests for my sitemap.xml document and I dont know how to do that :(

I have tried install an npm package libxmljs

npm install libxmljs --save

and load it as plugin in cypress/plugins/index.js

const libxmljs = require('libxmljs');

But there is a problem with this. It shows an error

The plugins file is missing or invalid.

Your pluginsFile is set to /home/my-app/cypress/plugins/index.js, but
either the file is missing,
it contains a syntax error, or threw an error when required.

The pluginsFile must be a .js or .coffee file.

Please fix this, or set pluginsFile to false if a plugins file is not
necessary for your project.

Error: The module '/home/my-app/node_modules/libxmljs/build/Release/xmljs.node'

Please help me, how can I use libxmljs in Cypress.io or how i should write tests for Sitemap.xml in this end-to-end testing tool.

Thanks for your time! :)


Solution

  • If you want to use libxmljs to parse your sitemap you should

    Those are the high-level steps you need to do 😉