问题是我如何做一个循环,我怎么能有一个很好的结果,如 94网址没问题,这三个都没有用。
var urls = [
'http://www.testify/page1',
'http://www.testify/page2'
];
module.exports = {
'validate some url': function (test) {
test.open('http://www.testify/page1')
.wait(500)
.assert.title().is.not('Die Seite wurde leider nicht gefunden')
.assert.url('http://www.testify/page1', 'URL is as expected')
.assert.numberOfElements('.product').is.gt(0, 'There are more than 0 products')
.done();
},
};
答案 0 :(得分:1)
var urls = [
'http://www.testify/page1',
'http://www.testify/page2'
];
module.exports = {
'validate some url': function (test) {
urls.forEach(function (url) {
test.open(url)
.wait(500)
.assert.title().is.not('Die Seite wurde leider nicht gefunden')
.assert.url(url, 'URL is as expected')
.assert.numberOfElements('.product').is.gt(0, 'There are more than 0 products')
});
test.done();
}
};
答案 1 :(得分:0)
module.exports = {
'A lot of screenshots': function (test) {
var resolutions = [{width: 1280, height: 1024}, {width: 1024, height: 768}, {width: 800, height: 600}];
var pages = ['http://facebook.com', 'http://twitter.com', 'http://dalekjs.com'];
resolutions.forEach(function (res) {
pages.forEach(function (page) {
test.open(page)
.resize(res)
.screenshot('pics/' + res.width + '_' + res.height + '_' + page.replace('http://', '') + '.png')
});
});
test.done();
}
}