I am trying to write a test for a canvas using protractor (Cucumber and chai).
I get a canvas from dom and convert it to base64encoded string and compare with the expected code. This test is working fine on my local (Windows) but not on jenkins (Linux) machine.
Jenkins is generating a bit longer and different base64 code of my canvas.
What can be the issue as I have no clue further to investigate and if its character set issue than how can I fix it?
Edit: Its not a duplicate I am trying find a solution in order to fix the encoding issues of canvas
await browser.executeScript("return document.querySelector('#testCard canvas').toDataURL(").then(async function (result) {
await expect(result).to.deep.equal(expectedImageCode);
});
or is there any alternative of toDataURL function?