當我試圖用量角器運行我的茉莉花規格時,我收到了很奇怪的測試規格行爲。量角器茉莉花空測試規格超時問題
我有兩個空的規格,兩個都應該通過,但是我的第一個規格通過,然後所有繼續規格失敗。我認爲這可能與版本級別有關,因爲當我進行更新時,它會導致我的茉莉花測試案例中斷。
- 量角器3.3.0
- 茉莉花2.4.1
測試規範
it('test spec 1', function() {
});
it('test spec 2', function() {
});
Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL.
'use strict';
exports.config = {
seleniumAddress: 'http://127.0.0.1:4723/wd/hub',
baseUrl: 'http://10.0.2.2:' + (process.env.HTTP_PORT || '8000'),
specs: [
'./e2e-test.js'
],
framework: 'jasmine',
jasmineNodeOpts: {
showColors: true,
isVerbose: true,
defaultTimeoutInterval: 30000,
print: function() {}
},
capabilities: {
deviceName:"Samsung S7",
platformName: 'Android',
'appium-version': '1.4.16',
platformVersion:'23',
app: 'C:/Users/egreen/Desktop/Android/foo/platforms/android/build/outputs/apk/android-debug.apk',
browserName:'',
udid:'988627534e4c383848',
autoWebview: true
},
// A callback function called when tests are started
onPrepare: function() {
var wd = require('wd'),
protractor = require('protractor'),
wdBridge = require('wd-bridge')(protractor, wd);
wdBridge.initFromProtractor(exports.config);
require('jasmine-reporters');
var fs = require('fs'),
d = new Date(),
date = [
d.getFullYear(),
('0' + (d.getMonth() + 1)).slice(-2),
('0' + d.getDate()).slice(-2)
].join('-'),
time = [
('0'+d.getHours()).slice(-2),
(('0'+d.getMinutes()).slice(-2)),
('0'+d.getSeconds()).slice(-2)
].join('');
var Jasmine2HtmlReporter = require('protractor-jasmine2-html-reporter');
jasmine.getEnv().addReporter(
new Jasmine2HtmlReporter({
savePath: 'target/reports/mobile-app/'+date+'/'+time+'/',
screenshotsFolder: 'images'
})
);
var SpecReporter = require('jasmine-spec-reporter');
jasmine.getEnv().addReporter(new SpecReporter({displayStacktrace: 'all'}));
},
};
確定這是發生在這個特定的測試?你能提供文件的完整內容和你的量角器配置嗎?謝謝! – alecxe
@alecxe是的,我確定這些測試正在發生。它非常奇怪的行爲。我還應該補充說我正在使用Appium。所以這也可能是該框架的問題。我將很快添加我的配置的內容。 –
@alecxe更新了我的問題。 –