栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 面试经验 > 面试问答

量角器在PhantomJS上运行测试

面试问答 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

量角器在PhantomJS上运行测试

从根本上来说,此修复为我解决了相同的问题:

https://github.com/pschwartau/protractor/commit/1eeff8b1b2e3e8f3b7c8152264411f26d4665a07

如此处最初所述:renanmartins的https://github.com/angular/protractor/issues/85#issuecomment-26846255


内部protractor / lib / protractor.js替换

this.driver.get('about:blank');this.driver.executescript(    'window.name = "' + DEFER_LABEL + '" + window.name;' +    'window.location.href = "' + destination + '"');

  var driver = this.driver;  this.getCapabilities().then(function (capabilities) {    if (capabilities.caps_.browserName === 'phantomjs') {      driver.executescript('window.name = "' + DEFER_LABEL + '" + window.name;');      driver.get(destination);    } else {      driver.get('about:blank');      driver.executescript(          'window.name = "' + DEFER_LABEL + '" + window.name;' +          'window.location.href = "' + destination + '"');    }    // Make sure the page is an Angular page.    driver.executeAsyncscript(clientSidescripts.testForAngular, 10).      then(function(hasAngular) {        if (!hasAngular) {          throw new Error('Angular could not be found on the page ' +   destination);        }      });  });


转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/616204.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号