jasmine2.0

Webpack directory appended at error after migrating to Angular9

雨燕双飞 提交于 2020-06-13 05:28:26
问题 I've recently upgraded my projet from angular 7 to angular 9. When I run the tests ( ng test ), I always get http://localhost:9876/_karma_webpack_/ appendend to the error, hence in visual studio code, we can't click on the error to got directly to the file. For the sake of testing, I've added expect(2).toEqual(1); in the app.component.spec.ts file For example, with the angular 7 projet out of the box, I get this error with ng test: Chrome 81.0.4044 (Windows 10.0.0) AppComponent should have as

How to create Protractor reports with Jasmine2

无人久伴 提交于 2020-02-20 06:31:43
问题 I have very recently started to use Protractor lib to test angularjs site.I tried to use below 2 libs to create HTML reports but in both cases I got the error https://www.npmjs.com/package/protractor-jasmine2-html-reporter and https://www.npmjs.com/package/protractor-jasmine2-screenshot-reporter. Platform:- Windows 7 Installation cmd:- npm install -g protractor-jasmine2-html-reporter Error: Cannot find module 'protractor-jasmine2-html-reporter' Config.js var Jasmine2HtmlReporter = require(

How to create Protractor reports with Jasmine2

女生的网名这么多〃 提交于 2020-02-20 06:28:24
问题 I have very recently started to use Protractor lib to test angularjs site.I tried to use below 2 libs to create HTML reports but in both cases I got the error https://www.npmjs.com/package/protractor-jasmine2-html-reporter and https://www.npmjs.com/package/protractor-jasmine2-screenshot-reporter. Platform:- Windows 7 Installation cmd:- npm install -g protractor-jasmine2-html-reporter Error: Cannot find module 'protractor-jasmine2-html-reporter' Config.js var Jasmine2HtmlReporter = require(

Protractor4.0.9 / jasmine2 / Chrome 54+: Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL

…衆ロ難τιáo~ 提交于 2020-01-05 06:53:42
问题 I know this question have been solved but it doesn't work for me. I upgrade to protractor4.0.9/Jasmine2, chromedriver 2.25, Chrome54. A simple test like this is failing: describe('Test', () => { it('should go to home', () => { browser.get('/#/home'); expect(browser.getCurrentUrl()).toContain('home'); }); it('should do something else', () => { expect(element(by.css('.element')).isPresent()).toEqual(true); }); }); it will never go through the second spec. Even though browser.get() is working.

jasmine protractor typescript to continue execution after one expected failure in it block

▼魔方 西西 提交于 2020-01-04 13:49:37
问题 I am using protractor-jasmine framework with typescript - so i have multiple it blocks within describe , so within each it block there are many methods or expect conditions i am verifying- so currently when one of the expect failed then whole it block is terminated , so i want to continue the execution even after one step fail. Below is Spec.ts it('Should display Introduction screen with title correctly', () => { page.navigateTo('/'); console.log('Verifying Title is displayed...'); expect

jasmine protractor typescript to continue execution after one expected failure in it block

我的梦境 提交于 2020-01-04 13:48:22
问题 I am using protractor-jasmine framework with typescript - so i have multiple it blocks within describe , so within each it block there are many methods or expect conditions i am verifying- so currently when one of the expect failed then whole it block is terminated , so i want to continue the execution even after one step fail. Below is Spec.ts it('Should display Introduction screen with title correctly', () => { page.navigateTo('/'); console.log('Verifying Title is displayed...'); expect

How can i coverage a promise response with Jasmine and Karma

狂风中的少年 提交于 2019-12-25 01:12:10
问题 I have a function that returns and treats a promise, I need to cover the return that is inside then but I don't know how I can do this, I'm currently trying as follows: confirmRemoveUser(user: IUser) { this.modalService .open('Confirma a exclusão do usuário selecionado?', { titleText: 'Confirmando exclusão', confirmButtonText: 'Sim', cancelButtonText: 'Cancelar', closeButtonText: 'Fechar', buttonType: 'danger' }) .result.then( (result: BentoModalConfirmationCloseReason) => { if (result ===

How jasmine clock works?

天涯浪子 提交于 2019-12-23 07:09:00
问题 I don't want to read code for hours to find the relevant part, but I am curious how jasmine implements its clock. The interesting thing with it is that it can test async code with sync testing code. AFAIK, with the current node.js, which supports ES5, this is not possible (async functions are defined in ES7). Does it parse the js code with something like estraverse and build an async test from the sync one? Just an example of what I am talking about: it("can test async code with sync testing

Protractor failed to start test with firefox

跟風遠走 提交于 2019-12-23 04:02:15
问题 I can not start the test with protractor on firefox version 56.0.1. my protractor version is 5.1.2 exports.config = { allScriptsTimeout: 11000, specs: [ './e2e/**/*.e2e-spec.ts' ], capabilities: { 'browserName': 'firefox' }, directConnect: true, baseUrl: 'http://localhost:4444/', framework: 'jasmine', jasmineNodeOpts: { showColors: true, defaultTimeoutInterval: 30000, print: function() {} }, }; this is the error: [00:02:20] I/launcher - Running 1 instances of WebDriver [00:02:20] I/direct -

Getting “$digest already in progress” in async test with Jasmine 2.0

戏子无情 提交于 2019-12-20 10:19:40
问题 I know that calling $digest or $apply manually during a digest cycle will cause a "$digest already in progress" error but I have no idea why I am getting it here. This is a unit test for a service that wraps $http , the service is simple enough, it just prevents making duplicate calls to the server while ensuring that code that attempts to do the calls still gets the data it expected. angular.module('services') .factory('httpService', ['$http', function($http) { var pendingCalls = {}; var