Я новичок в Appium, поэтому могу сделать что-то не так.
У меня проблема с appium с использованием wdio и jasmine
it('wtf', (done) => {
client.init().element('someName').getText()
// ^ here was a mistake
.then(result => result, err => {
// ^ this error handling wasn't work
throw new Error(`Cannot get text of element: #someName\n${err}`);
})
.then(text => expect(text).toBe('correct'))
.then(done)
});
журнал сервера appium сказал мне:
[HTTP] --> POST /wd/hub/session/63aa60d2-9638-4b1a-a226-cfbb2fcfce2c/element {"using":"css selector","value":"someName"}
[debug] [MJSONWP] Calling AppiumDriver.findElement() with args: ["css selector","someName","63aa60d2-9638-4b1a-a226-cfbb2fcfce2c"]
[debug] [BaseDriver] Valid locator strategies for this request: xpath, id, class name, accessibility id, -android uiautomator
[HTTP] <-- POST /wd/hub/session/63aa60d2-9638-4b1a-a226-cfbb2fcfce2c/element 500 4 ms - 152
[HTTP] --> POST /wd/hub/session {"desiredCapabilities":{"javascriptEnabled":true,"locationContextEnabled":true,"handlesAlerts":true,"rotatable":true,"platformName":"android","app":"./app-dev-debug.apk","appPackage":"com.#####.dev.debug","appActivity":"com.#####.feature.start.StartActivity","avdReadyTimeout":1000,"udid":"LGK350RGNBS4TS","deviceName":"LG-K350","clearSystemFiles":true,"fullReset":true,"newCommandTimeout":120,"requestOrigins":{"url":"http://webdriver.io","version":"4.12.0","name":"webdriverio"}}}
но jsmine застрял без выданной ошибки, журнал:
Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL.
Stack:
Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL.
at ontimeout (timers.js:475:11)
at tryOnTimeout (timers.js:310:5)
at Timer.listOnTimeout (timers.js:270:5)
«готово» не было обещанием
настроенное время ожидания жасмина = 300000
главный вопрос: почему Жасмин не получает выброшенное исключение?