safari下CORS的XMLHttpRequest的status为0,是什么原因
1个回答
展开全部
safari下CORS的XMLHttpRequest的status为0,是什么原因
本示例以 React 组件autoresponsive-react为例说明,对 UI 功能进行一些操作,配合截图等方式辅助校验。
describe('base', function() {
this.timeout(5 * 60 * 1000);
var driver = wd.initPromiseChain();
driver.configureHttp({
timeout: 300 * 60 * 1000
});
before(function() {
return driver
.initDriver();
});
after(function() {
return driver
.sleep(1000)
.quit();
});
it('#1 login picture should be the same.', function() {
return driver
.sleep(40 * 1000)
.waitForElementByName('autoresponsive')
.takeScreenshot()
.then(imgData => {
var newImg = new Buffer(imgData, 'base64');
var screenshotFolder = path.resolve(__dirname, '../screenshot');
var oldImgPath = path.join(screenshotFolder, process.env.platform === 'android' ? 'android.png' : 'ios.png');
var diffImgPath = path.join(screenshotFolder, process.env.platform === 'android' ? 'android-diff.png' : 'ios-diff.png');
return diffImage(oldImgPath, newImg, 0.3, diffImgPath);
})
.then(result => {
result.should.be.true();
})
.catch(e => {
console.log(e);
});
});
});
本示例以 React 组件autoresponsive-react为例说明,对 UI 功能进行一些操作,配合截图等方式辅助校验。
describe('base', function() {
this.timeout(5 * 60 * 1000);
var driver = wd.initPromiseChain();
driver.configureHttp({
timeout: 300 * 60 * 1000
});
before(function() {
return driver
.initDriver();
});
after(function() {
return driver
.sleep(1000)
.quit();
});
it('#1 login picture should be the same.', function() {
return driver
.sleep(40 * 1000)
.waitForElementByName('autoresponsive')
.takeScreenshot()
.then(imgData => {
var newImg = new Buffer(imgData, 'base64');
var screenshotFolder = path.resolve(__dirname, '../screenshot');
var oldImgPath = path.join(screenshotFolder, process.env.platform === 'android' ? 'android.png' : 'ios.png');
var diffImgPath = path.join(screenshotFolder, process.env.platform === 'android' ? 'android-diff.png' : 'ios-diff.png');
return diffImage(oldImgPath, newImg, 0.3, diffImgPath);
})
.then(result => {
result.should.be.true();
})
.catch(e => {
console.log(e);
});
});
});
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询