TravisCI and SauceLabs - the file does not exist in the file system

I have a project that has Protractor tests that are run by TravisCI through SauceLabs.

One of the tests involves β€œdownloading” a file:

it('should not allow "image/jpeg" file', function () {
  pathToFile = path.resolve(__dirname, 'file.jpg');
  elem.sendKeys(pathToFile);
  expect(elem.getAttribute('class')).toMatch('ng-invalid');
});

This works fine locally, however Travis generates an error:

.,. / file.jpg 'does not exist on the file system

I think this is because it file.pngdoes not exist on SauceLabs.

My question is: how can I make this work?

The corresponding directive is: https://github.com/GrumpyWizards/ngValidation/blob/master/wizValidation/src/file/file.dir.js

+4
source share
1 answer

UI, ...

it('should not allow "image/jpeg" file', function () {
  pathToFile = "path/is/not/important/file.jpg";
  elem.sendKeys(pathToFile);
  expect(elem.getAttribute('class')).toMatch('ng-invalid');
});

0

Source: https://habr.com/ru/post/1537725/


All Articles