'How to automate the Symantec VIP access code using cypress?

I am planning to automate the Symantec VIP code using Cypress tool. I am using cypress-otp as npm package. It is generating the 6 digit passcode but unfortunately, it doesn't work. Because, the passcode which is getting generated might not be correct since I am using cypress-otp npm package.

Here is the experiment which I have done so far -

fixture-

{
  CREDENTIAL : "______"
}

command.js-

cy.task('generateCode', CREDENTIAL).then(token => {
    cy.get('.passCode').type(token, {force: true});
});

plugin.js-

module.exports = (on, config) => {
    on("task", { generateCode: require("cypress-otp") });
};

I am getting error as Authentication failed. Since the code which is being generated is not valid looks like. But when I used okta credential for the same package cypress-otp, it is working fine.

Do we have any existing npm package to handle symantec VIP automation? Or any other way to automate the passcode generation.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source