我正在量角器测试中上传了一个.csv文件。它在Windows中工作正常,但在Linux中却出现了脚本超时。
我调试了文件路径,看起来不错。我还在上传之前设置了waitForAngular(false),并在之后启用了它。
我的测试:
describe('something', () => {
it('somethingElse', async () => {
await browser.get("https://somedomain.com");
await browser.driver.sleep(2000);
await browser.wait(EC.visibilityOf($('mat-card-content')),5000);
var fileToUpload = '../ressources/file.csv';
var filepath = path.resolve(__dirname, fileToUpload);
let importBtn = element(by.css('input[type="file"]'));
await importBtn.sendKeys(filepath);
...
})
})
Windows的文件路径:
C:\Users\mat\project\ressources\file.csv
Linux的文件路径:
/home/user/project/ressources/file.csv
我的错误消息:
ScriptTimeoutError: script timeout: result was not received in 100 seconds
(Session info: headless chrome=74.0.3729.131)
(Driver info: chromedriver=74.0.3729.6 (255758eccf3d244491b8a1317aa76e1ce10d57e9-refs/branch-heads/3729@{#29}),platform=Linux 4.15.0-1023-aws x86_64)
at Object.checkLegacyResponse (/jenkins/workspace/Protractor_Stage/node_modules/selenium-webdriver/lib/error.js:546:15)
at parseHttpResponse (/jenkins/workspace/Protractor_Stage/node_modules/selenium-webdriver/lib/http.js:509:13)
at doSend.then.response (/jenkins/workspace/Protractor_Stage/node_modules/selenium-webdriver/lib/http.js:441:30)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:189:7)
然后给我描述/说明行。