angularjs-e2e

Exit Protractor e2e test on fail?

只愿长相守 提交于 2019-12-01 05:45:09
Does anyone out there know if there is a config that can be added to protractor's e2e.conf.js so it exits the test once it fails? Default behaviour is that if a test fails early on, you need to wait until it finishes to fix the error. From a workflow perspective, this is very frustrating. Any solutions to this problem? Thanks no this option is missing. you could implement jasmine-bail-fast 来源: https://stackoverflow.com/questions/25496290/exit-protractor-e2e-test-on-fail

Protractor 0.16.1 e2e AngularJS - Starting selenium standalone server… events.js:72 Error: spawn ENOENT

孤街醉人 提交于 2019-12-01 05:04:30
Attempted Project: https://github.com/yearofmoo/angularjs-seed-repo Environment: Windows 7 64-bit NodeJS v 0.10.24 Protractor v 0.16.1 grunt v0.4.2 grunt-cli v0.1.11 Notes: For selenium, install_selenium_standalone has been replaced by webdriver-manager binary around 12/2/13 according to [Julie's post][1]. This seems to be related to the issue. Also, git must be installed in the project directory and npm install must be run using Git Bash in Windows. Error in Git Bash: $ grunt test:e2e --debug Running "connect:testserver" (connect) task [D] Task source: c:\nodejs-0.10.24\node_modules\grunt

How can I make Protractor NOT wait for $timeout?

爱⌒轻易说出口 提交于 2019-12-01 04:22:11
I'm testing my angular application with Protractor. Once the user is logged in to my app, I set a $timeout to do some job in one hour (so if the user was logged-in in 13:00, the $timeout will run at 14:00). I keep getting these failures: "Timed out waiting for Protractor to synchronize with the page after 20 seconds. Please see https://github.com/angular/protractor/blob/master/docs/faq.md. The following tasks were pending: - $timeout: function onTimeoutDone(){....." I've read this timeouts page: https://github.com/angular/protractor/blob/master/docs/timeouts.md so I understand Protractor waits

How can I add URL's dynamically to Protractor tests?

拜拜、爱过 提交于 2019-12-01 04:20:23
问题 I am trying to use protractor in conjunction with Jenkins. In my jenkins, I need to have URLs dynamically generated. So while running protractor tests, for example: describe('angularjs homepage', function() { it('should greet the named user', function() { // Load the AngularJS homepage. browser.get('http://www.angularjs.org'); element(by.model('yourName')).sendKeys('testUser'); }); }); In above example I want to pass a variable dynamically in place of "http://www.angularjs.org". I could not

Exit Protractor e2e test on fail?

冷暖自知 提交于 2019-12-01 03:11:48
问题 Does anyone out there know if there is a config that can be added to protractor's e2e.conf.js so it exits the test once it fails? Default behaviour is that if a test fails early on, you need to wait until it finishes to fix the error. From a workflow perspective, this is very frustrating. Any solutions to this problem? Thanks 回答1: no this option is missing. you could implement jasmine-bail-fast 来源: https://stackoverflow.com/questions/25496290/exit-protractor-e2e-test-on-fail

Protractor addMockModule and $httpProvider interceptor

不羁岁月 提交于 2019-11-30 19:13:29
This question is a possible solution for my other question (where they advice to use addMockModule from protractor): Call other api when running tests using Protractor . I have the following file: mockedRest.js this is the module I want to add to protractor. It should intercept any REST calls and replace the address (api/ to apiMock/). exports.apiMockModule = function () { console.log('apiMockModule executing'); var serviceId = 'mockedApiInterceptor'; angular.module('apiMockModule', ['myApp']) .config(['$httpProvider', configApiMock]) .factory(serviceId, [mockedApiInterceptor]); function

Running AngularJS Protractor with proxy to https

巧了我就是萌 提交于 2019-11-30 15:17:37
I get the following error in the command line when trying to run Protractor: > Fatal error: protractor exited with code: 1 I need to proxy to an https test server. How do I accomplish this? I followed the advice from this Github issue , but I am still getting the above error. Here is my config file: // A reference configuration file. exports.config = { // ----- How to setup Selenium ----- // // There are three ways to specify how to use Selenium. Specify one of the // following: // // 1. seleniumServerJar - to start Selenium Standalone locally. // 2. seleniumAddress - to connect to a Selenium

How to test drag & drop functionality in AngularJS e2e testing

◇◆丶佛笑我妖孽 提交于 2019-11-30 13:17:21
I am trying to test my application where I need to move a widget from one location to other, in other word I need to test drag & drop functionality in an end to end test. How would I test this? Brady Isom I had this same issue. The solution for me was to follow the advice in the Selenium issue here: https://code.google.com/p/selenium/issues/detail?id=3604#c20 Starting with the example from @nilsK, here was my solution: var yourOffset = {x:5,y:5}; ptor().actions() .mouseMove(yourElement,yourOffset) .mouseDown() .mouseMove(yourElement,{x:0,y:0}) // Initial move to trigger drag start .mouseMove

How to validate when a checkbox is checked in AngularJS e2e tests?

主宰稳场 提交于 2019-11-30 10:49:52
I've been trying out the AngularJS e2e tests and am getting stuck determining whether or not a checkbox is checked. I used the end to end test for the checkbox input as a sample (see the End to end test tab in the Example ). Html snippet: Value1: <input type="checkbox" ng-model="value1"> <br/> Controller snippet: function Ctrl($scope) { $scope.value1 = true; } Here is what I tried: 1) expect(binding('value1')).toEqual('true'); This works in the sample end to end test as long as value1 is displayed on screen with {{value1}} . If you test this locally and remove `{{value1}} the binding test

Call other api when running tests using Protractor

吃可爱长大的小学妹 提交于 2019-11-30 09:25:07
问题 I currently have setup some tests using protractor. These tests are retrieving data from a WebApi. However, I want to point the WebApi calls to a real but mocked WebApi that just returns the objects I want to use as test data. For example, the current request is: http://localhost/myApp/api/profile/getUser/1 I want to manipulate this request so the test will use: http://localhost/myApp/apiMock/profile/getUser/1 First I thought to write an interceptor that changes the request header but I don't