protractor

JasmineNodeOpts - Printing Protractor Test Results

半腔热情 提交于 2020-01-23 08:06:07
问题 Background : I'm using Jasmine as my test framework for Protractor, I've been using jasmine spec reporter for reporting. Yesterday I slightly changed my jasmineNodeOpts parameters in my protractor conf.js to include the print() function i.e. jasmineNodeOpts: { showColors: true, defaultTimeoutInterval: 120000, includeStackTrace : true, isVerbose : true, print: function () {} }, I added this print function because I learned it would remove the . before each report. For example, my test reports

Protractor - Error Handling in Framework

一个人想着一个人 提交于 2020-01-23 02:53:04
问题 How can we handle error in a Protractor - Cucumber based framework? There are assert failures, which is a genuine fail and there are errors in javascript code (e.g. - element not found, array is empty, something undefined etc..). I wish to handle the later in a graceful manner. Currently Protractor tests fail for the said errors but the messages are not friendly and hard to comprehend. They mostly point to location of errors in protractor library files and not where the actual error occurred

toBe(true) vs toBeTruthy() vs toBeTrue()

浪子不回头ぞ 提交于 2020-01-22 04:04:47
问题 What is the difference between expect(something).toBe(true) , expect(something).toBeTruthy() and expect(something).toBeTrue() ? Note that toBeTrue() is a custom matcher introduced in jasmine-matchers among other useful and handy matchers like toHaveMethod() or toBeArrayOfStrings() . The question is meant to be generic, but, as a real-world example, I'm testing that an element is displayed in protractor . Which matcher should I use in this case? expect(elm.isDisplayed()).toBe(true); expect(elm

swipe and click a button protractor

放肆的年华 提交于 2020-01-21 09:41:53
问题 i need to swipe an item and need to click on a button in that item, i used this the test is success but i could not view that button this test case is written to swipe left and make a button visible and click on that button it('should delete a product',function(){ browser.driver.actions().mouseMove({x:-50,y:0}).perform(); browser.sleep(3000); }); could someone help me to swipe the delete button is <ion-option-button ng-show="!userService.isOffline" class="button button-assertive button

Unable to parse new session response, when run Protractor test in firefox

我们两清 提交于 2020-01-21 08:37:49
问题 Protractor version : 5.1.1, Firefox version: 47, webdriver version : v0.15.0 I get following error when I try to run Protractor test in Firefox: [15:13:47] I/launcher - Running 1 instances of WebDriver [15:13:47] I/direct - Using FirefoxDriver directly... [15:13:53] E/launcher - Unable to parse new session response: {"value": {"sessionId":"e8dc5d2f-a3bd-45db-89c1-a023e31e08e6","value":{"XULappId":"{ec80 30f7-c20a-464f-9b0e-13a3a9e97384}","acceptSslCerts":false,"appBuildId":"20160604131506",

Unable to parse new session response, when run Protractor test in firefox

白昼怎懂夜的黑 提交于 2020-01-21 08:37:37
问题 Protractor version : 5.1.1, Firefox version: 47, webdriver version : v0.15.0 I get following error when I try to run Protractor test in Firefox: [15:13:47] I/launcher - Running 1 instances of WebDriver [15:13:47] I/direct - Using FirefoxDriver directly... [15:13:53] E/launcher - Unable to parse new session response: {"value": {"sessionId":"e8dc5d2f-a3bd-45db-89c1-a023e31e08e6","value":{"XULappId":"{ec80 30f7-c20a-464f-9b0e-13a3a9e97384}","acceptSslCerts":false,"appBuildId":"20160604131506",

Breaking out of a Protractor .filter() or .map() loop

北慕城南 提交于 2020-01-20 08:43:56
问题 I'm using Protractor and cucumber framework; how do I break out of a .filter or .map loop? I do not want to continue to iterate further if I found a match! Page.prototype.getElementByKey = function (key) { var foundElement = null; return someElement.all(by.css('.someClass')).map(function (rawItem, index) { var itemObject = new ItemObjectClass(rawItem); return itemObject.getItemKey().then(function (foundItemKey) { var matched = String(foundItemKey).trim() === String(key).trim(); console.log('

Breaking out of a Protractor .filter() or .map() loop

核能气质少年 提交于 2020-01-20 08:43:11
问题 I'm using Protractor and cucumber framework; how do I break out of a .filter or .map loop? I do not want to continue to iterate further if I found a match! Page.prototype.getElementByKey = function (key) { var foundElement = null; return someElement.all(by.css('.someClass')).map(function (rawItem, index) { var itemObject = new ItemObjectClass(rawItem); return itemObject.getItemKey().then(function (foundItemKey) { var matched = String(foundItemKey).trim() === String(key).trim(); console.log('

Breaking out of a Protractor .filter() or .map() loop

心已入冬 提交于 2020-01-20 08:42:07
问题 I'm using Protractor and cucumber framework; how do I break out of a .filter or .map loop? I do not want to continue to iterate further if I found a match! Page.prototype.getElementByKey = function (key) { var foundElement = null; return someElement.all(by.css('.someClass')).map(function (rawItem, index) { var itemObject = new ItemObjectClass(rawItem); return itemObject.getItemKey().then(function (foundItemKey) { var matched = String(foundItemKey).trim() === String(key).trim(); console.log('

protractor with any headless browser?

时光毁灭记忆、已成空白 提交于 2020-01-20 05:17:29
问题 I am using protractor and it works when I specify chrome as the browsertype. I am looking for a headless browser sample code, I have looked for phantomJs but I could not run any of them. Is there a working sample available of another headless browser? 回答1: No other headless browser out there besides PhantomJS while the latter is a dead-end with Protractor. You can try docker-selenium or, if you don't like Docker you can do it yourself with ubuntu-headless sample. Both solutions provide Chrome