我正在尝试对一个组件进行单元测试,该组件具有使用declare关键字声明的变量,并且它有几个方法,然后在组件中稍后调用,如下所示:
import {
Component,
OnInit
} from '@angular/core';
import {
AlertController,
App,
Events,
Platform
} from "ionic-angular";
declare
let PushNotification: any;
@Component({
selector: 'push',
template: ``
})
export class PushComponent implements OnInit {
nav: any;
_push: any;
constructor() {}
ngOnInit() {
// ...
this._push = PushNotification.init({
android: {
senderID: '...'
},
ios: {
alert: "true",
badge: false,
sound: 'false'
},
windows: {}
});
/**
* On Registration, we want to register the device with BE
*/
this._push.on('registration', (data) …Run Code Online (Sandbox Code Playgroud)我试图同时运行在Chrome和Firefox我的量角器的测试,并已明确告知它与chromedriver的V2.30运行,但试图使用旧版本geckodriver时(运行webdriver-manager update --versions.firefox=0.17.0,webdriver-manager update --versions.gecko=0.17.0和webdriver-manager update --versions.geckodriver=0.17.0),它仍然安装最新版本(撰写本文时为0.18.0).
有没有办法为Firefox安装特定版本的驱动程序?如果是,那是什么?
angular ×1
firefox ×1
jasmine ×1
javascript ×1
karma-runner ×1
protractor ×1
selenium ×1
unit-testing ×1