Здравствуйте. У меня наоборот, проваленные тесты - зеленые но с выводом ошибки в конце. Скачал для примера тесты вот отсюда sample-code/sample-code/examples/node at master · appium-boneyard/sample-code · GitHub , поправил в /helpers и изменил шаги в android-simple.js в return - так вот из двух тестов сделал что бы оба не проходили - но в консоле показывает что 2 test passing и оба отмечены зеленой отметкой(если первый же не прошел - должно остановится) и может второй тест начаться не закончивши первый , хотя в конце каждого пишет что в обоих были fail.
Подскажите почему так или где прочитать про синтаксис тестов ?
android simple
undefined undefined
undefined /session undefined
undefined
undefined undefined “9ec3ab50-3ca8-4a26-b3f4-65d310dd8e39”,null
undefined undefined
undefined /session/:sessionID/timeouts/implicit_wait undefined
undefined undefined
undefined undefined
✓ should scroll and tap
undefined undefined
undefined /session/:sessionID/element undefined
undefined undefined
undefined undefined
undefined /session/:sessionID/touch/perform undefined
undefined undefined true
undefined undefined
undefined /session/:sessionID/touch/perform undefined
undefined undefined true
undefined undefined
undefined undefined
undefined /session/:sessionID/elements undefined
fail {“message”:“[elementByXPath("//android.widget.RelativeLayout[1]/android.view.View[1]/android.widget.FrameLayout[1]/android.view.View[1]/android.widget.LinearLayout[1]/android.widget.FrameLayout[1]/android.view.View[1]/android.widget.RelativeLayout[1]/android.widget.ImageButton[1]")] Error response status: 7, , NoSuchElement - An element could not be located on the page using the given search parameters. Selenium error: An element could not be located on the page using the given search paramete…
✓ tap 6 menu (6543ms)
undefined undefined
undefined /session/:sessionID undefined
fail {“message”:”[waitForElementByName("Let’s go!!")] [elements("name","Let’s go!!")] Error response status: 13, , UnknownError - An unknown server-side error occurred while processing the command. Selenium error: An unknown server-side error occurred while processing the command.",“status”:13,“cause”:{“status”:13,“value”:{“message”:“An unknown server-side error occurred while processing the command.”,“origValue”:"We’re in the middle of shutting down the Android device, so your request won’t be…
undefined undefined
undefined
undefined undefined
2 passing (14s)
вот сам подопытный
“use strict”;
// run mocha …
require(“./helpers/setup”);
var wd = require(“wd”),
_ = require(‘underscore’),
serverConfigs = require(‘./helpers/appium-servers’),
actions = require(“./helpers/actions”),
assert = require(“assert”),
required = require(“events”);
wd.addPromiseChainMethod(‘swipe’, actions.swipe);
describe(“android simple”, function () {
this.timeout(300000);
var driver;
var allPassed = true;
before(function () {
var serverConfig = serverConfigs.local;
driver = wd.promiseChainRemote(serverConfig);
require(“./helpers/logging”).configure(driver);
var desired = _.clone(require(“./helpers/caps”).android18);
desired.app = require(“./helpers/apps”).androidApiDemos;
if (process.env.SAUCE) {
desired.name = ‘android - simple’;
desired.tags = [‘sample’];
}
return driver
.init(desired)
.setImplicitWaitTimeout(5000);
});
after(function () {
return driver
.quit()
.finally(function () {
if (process.env.SAUCE) {
return driver.sauceJobStatus(allPassed);
}
});
});
afterEach(function () {
allPassed = allPassed && this.currentTest.state === ‘passed’;
});
it(“should scroll and tap”, function () {
driver
.sleep(3000)
.swipe({startX: 900, startY: 900, endX: 9, endY: 900, duration: 1000})
.swipe({startX: 900, startY: 900, endX: 9, endY: 900, duration: 1000})
.swipe({startX: 900, startY: 900, endX: 9, endY: 900, duration: 1000})
.waitForElementByName (“Let’s go!!”).click()
.fail(function (err) {
console.log(‘fail’, err)
})
.sleep(3000)
})
it(“tap 6 menu”, function () {
return driver
.elementByXPath(“//android.widget.RelativeLayout[1]/android.view.View[1]/android.widget.FrameLayout[1]/android.view.View[1]/android.widget.LinearLayout[1]/android.widget.FrameLayout[1]/android.view.View[1]/android.widget.RelativeLayout[1]/android.widget.ImageButton[1]”).click()
.elementByXPath(“//android.widget.RelativeLayout[1]/android.view.View[2]/android.widget.RelativeLayout[1]/android.widget.ScrollView[1]/android.widget.LinearLayout[1]/android.widget.LinearLayout[2]/android.widget.LinearLayout[1]/android.widget.RelativeLayout[1]/android.widget.TextView[1]”).click()
.waitForElementByName (“You don’t have any favorites airports. You can search and add new airport to this list.”)
.then( function() {
return driver.assert.equal(text, 0 , “you have favorit airports”)
})
.elementByXPath(“//android.widget.RelativeLayout[1]/android.view.View[1]/android.widget.FrameLayout[1]/android.view.View[1]/android.widget.LinearLayout[1]/android.widget.FrameLayout[1]/android.view.View[1]/android.widget.RelativeLayout[1]/android.widget.ImageButton[1]”).click()
.elementByXPath(“//android.widget.RelativeLayout[1]/android.view.View[2]/android.widget.RelativeLayout[1]/android.widget.ScrollView[1]/android.widget.LinearLayout[1]/android.widget.LinearLayout[3]/android.widget.LinearLayout[1]/android.widget.RelativeLayout[1]/android.widget.TextView[1]”).click()
.waitForElementByName (“You don’t have any favorites airlines. You can search and add new airline to this list.”)
.then( function() {
return driver.assert.equal(text, 0 , “you have favorit airlines”)
})
.elementByXPath(“//android.widget.RelativeLayout[1]/android.view.View[1]/android.widget.FrameLayout[1]/android.view.View[1]/android.widget.LinearLayout[1]/android.widget.FrameLayout[1]/android.view.View[1]/android.widget.RelativeLayout[1]/android.widget.ImageButton[1]”).click()
.elementByXPath(“//android.widget.RelativeLayout[1]/android.view.View[2]/android.widget.RelativeLayout[1]/android.widget.ScrollView[1]/android.widget.LinearLayout[1]/android.widget.LinearLayout[4]/android.widget.LinearLayout[1]/android.widget.RelativeLayout[1]/android.widget.TextView[1]”).click()
.waitForElementByName (“Radar”)
.then( function() {
return driver.assert.equal(text, 0 , “you have radar”)
})
.elementByXPath(“//android.widget.RelativeLayout[1]/android.view.View[1]/android.widget.FrameLayout[1]/android.view.View[1]/android.widget.LinearLayout[1]/android.widget.FrameLayout[1]/android.view.View[1]/android.widget.RelativeLayout[1]/android.widget.ImageButton[1]”).click()
.elementByXPath(“//android.widget.RelativeLayout[1]/android.view.View[2]/android.widget.RelativeLayout[1]/android.widget.ScrollView[1]/android.widget.LinearLayout[1]/android.widget.LinearLayout[5]/android.widget.LinearLayout[1]/android.widget.RelativeLayout[1]/android.widget.TextView[1]”).click()
.elementByXPath(“//android.widget.RelativeLayout[1]/android.view.View[1]/android.widget.FrameLayout[1]/android.view.View[1]/android.widget.LinearLayout[1]/android.widget.FrameLayout[1]/android.view.View[1]/android.widget.RelativeLayout[1]/android.widget.ImageButton[1]”).click()
.elementByXPath(“//android.widget.RelativeLayout[1]/android.view.View[2]/android.widget.RelativeLayout[1]/android.widget.ScrollView[1]/android.widget.LinearLayout[1]/android.widget.LinearLayout[6]/android.widget.LinearLayout[1]/android.widget.RelativeLayout[1]/android.widget.TextView[1]”).click()
.fail(function (err) {
console.log(‘fail’, err)
})
});
});