Я пытаюсь проверить функциональность загрузки документов PDF, однако она работает нормально на локальном компьютере, где она выбирает путь из локальной папки, но не работает как часть выполнения интеграции Bamboo + Sauce + Qtest.
Below is the code snippet i have used to upload the documentin local which is working fine :
var path = require('path');
var absolutePath = path.resolve(__dirname, "../uploads/Replace.pdf");
element(by.css('input[type=file][ng-model="detailDocuments.selectedFiles.selectedIbl"]')).sendKeys(absolutePath);
browserActions.clickOn(applicants.uploadBtn('Replace'));
Below is the code snippet which i have used to upload document as part of CI.
var path = require('path');
var remote = require('selenium-webdriver/remote');
browser.setFileDetector(new remote.FileDetector());
var absolutePath = path.resolve(__dirname, "../uploads/Replace.pdf");
element(by.css('input[type=file][ng-model="detailDocuments.selectedFiles.selectedIbl"]')).sendKeys(absolutePath);
browser.sleep(2000);
browserActions.clickOn(applicants.uploadBtn('Replace'));
browser.sleep(3000);
In the bamboo it showing below error message:
Failures:
build 18-Feb-2019 13:15:56 1) IEATA.2356*: validation_for_upload_or_replace_documents_IEATA-2356 IEATA-2356 step 4: verification of applicantdetails page
build 18-Feb-2019 13:15:56 Message:
build 18-Feb-2019 13:15:56 [31m Failed: invalid argument: File not found : /opt/atlassian-bamboo/bamboo-agent-home/xml-data/build-dir/EQ-PBR-JOB1/regression/bws/uploads/Test.pdf
build 18-Feb-2019 13:15:56 (Session info: chrome=71.0.3578.80)
build 18-Feb-2019 13:15:56 (Driver info: chromedriver=2.44.609538 (b655c5a60b0b544917107a59d4153d4bf78e1b90),platform=Windows NT 6.1.7601 SP1 x86_64)[0m
build 18-Feb-2019 13:15:56 Stack:
build 18-Feb-2019 13:15:56 WebDriverError: invalid argument: File not found : /opt/atlassian-bamboo/bamboo-agent-home/xml-data/build-dir/EQ-PBR-JOB1/regression/bws/uploads/Test.pdf
build 18-Feb-2019 13:15:56 (Session info: chrome=71.0.3578.80)
build 18-Feb-2019 13:15:56 (Driver info: chromedriver=2.44.609538
The PDF documents are available in protractor/uploads.