vendredi 28 février 2020

Java test Intelij IDEA vs Jenkins(selenium server) encoding

I have Selenium tests in Java and if I run it on my Intelij IDEA it works fine, but when it runs via Jenkins on Selenium server it has a problem with encoding.

There is code which loads text file on the disc:

public static List<String> getExpectedSpells() throws FileNotFoundException {
   FileReader fileReader = new FileReader(new File("src/test/resources/testData/spells.txt"));
   BufferedReader br = new BufferedReader(fileReader);
   return br.lines().collect(Collectors.toList());
}

It returns a list of strings to compare with text on the page. One line returns this demaged dash

  1. Actual: controls a person - unforgivable
  2. Expected: controls a person – unforgivable // comes from text file

EDIT: If looks like a Jenkins problem. Cause Selenium Server works ok if I run it directly via sel. server.

Can somebody tell me please what is wrong? I have no idea. Thanks.

Aucun commentaire:

Enregistrer un commentaire