protractor

protractor with any headless browser?

我只是一个虾纸丫 提交于 2020-01-20 05:17:07
问题 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

How to import js-modules into TypeScript file?

你说的曾经没有我的故事 提交于 2020-01-18 15:53:13
问题 I have a Protractor project which contain such a file: var FriendCard = function (card) { var webElement = card; var menuButton; var serialNumber; this.getAsWebElement = function () { return webElement; }; this.clickMenuButton = function () { menuButton.click(); }; this.setSerialNumber = function (numberOfElements) { serialNumber = numberOfElements + 1; menuButton = element(by.xpath('.//*[@id=\'mCSB_2_container\']/li[' + serialNumber + ']/ng-include/div/div[2]/i')); }; this.deleteFriend =

How to import js-modules into TypeScript file?

☆樱花仙子☆ 提交于 2020-01-18 15:51:49
问题 I have a Protractor project which contain such a file: var FriendCard = function (card) { var webElement = card; var menuButton; var serialNumber; this.getAsWebElement = function () { return webElement; }; this.clickMenuButton = function () { menuButton.click(); }; this.setSerialNumber = function (numberOfElements) { serialNumber = numberOfElements + 1; menuButton = element(by.xpath('.//*[@id=\'mCSB_2_container\']/li[' + serialNumber + ']/ng-include/div/div[2]/i')); }; this.deleteFriend =

How to import js-modules into TypeScript file?

坚强是说给别人听的谎言 提交于 2020-01-18 15:51:46
问题 I have a Protractor project which contain such a file: var FriendCard = function (card) { var webElement = card; var menuButton; var serialNumber; this.getAsWebElement = function () { return webElement; }; this.clickMenuButton = function () { menuButton.click(); }; this.setSerialNumber = function (numberOfElements) { serialNumber = numberOfElements + 1; menuButton = element(by.xpath('.//*[@id=\'mCSB_2_container\']/li[' + serialNumber + ']/ng-include/div/div[2]/i')); }; this.deleteFriend =

How to import js-modules into TypeScript file?

给你一囗甜甜゛ 提交于 2020-01-18 15:50:10
问题 I have a Protractor project which contain such a file: var FriendCard = function (card) { var webElement = card; var menuButton; var serialNumber; this.getAsWebElement = function () { return webElement; }; this.clickMenuButton = function () { menuButton.click(); }; this.setSerialNumber = function (numberOfElements) { serialNumber = numberOfElements + 1; menuButton = element(by.xpath('.//*[@id=\'mCSB_2_container\']/li[' + serialNumber + ']/ng-include/div/div[2]/i')); }; this.deleteFriend =

gulp-protractor error with chrome v54 / web driver v2.25

◇◆丶佛笑我妖孽 提交于 2020-01-17 05:22:20
问题 Due to the latest update of chrome (v54) we've noticed our protractor tests failing. We attempted to update to the latest version of gulp-protractor (v3.0.0) which in turn downloads the latest web driver (v2.25) to resolve the issue but unfortunately a new error occurs we've been unable to resolve. Everything worked fine before chrome's update. Our protractor configuration is as follows: exports.config = { // Capabilities to be passed to the webdriver instance. capabilities: { 'browserName':

gulp-protractor error with chrome v54 / web driver v2.25

落爺英雄遲暮 提交于 2020-01-17 05:22:04
问题 Due to the latest update of chrome (v54) we've noticed our protractor tests failing. We attempted to update to the latest version of gulp-protractor (v3.0.0) which in turn downloads the latest web driver (v2.25) to resolve the issue but unfortunately a new error occurs we've been unable to resolve. Everything worked fine before chrome's update. Our protractor configuration is as follows: exports.config = { // Capabilities to be passed to the webdriver instance. capabilities: { 'browserName':

check if element is present in protractor

时间秒杀一切 提交于 2020-01-16 18:54:28
问题 I have an angular application where user can get a different login screen(non-angular) based on her/his browser cache. I am writing end to end test cases using protractor and I want to put a condition something like this if(this element is present) { click it } else check if this element is pressent { click it } This is what I have tried. browser.driver.findElements(by.id('element1')).then(function(result) { if (result) { browser.driver.findElement(by.id('element1')).click(); } else { browser

post request with XMLHttpRequest javascript

本小妞迷上赌 提交于 2020-01-16 18:09:12
问题 I tried to send post request but always get: 403 and Authentication requires const XMLHttpRequest = require("xmlhttprequest").XMLHttpRequest; const http = new XMLHttpRequest(); const url = "https://mywebsite.com/api/comment"; const params = 'comment=test'; http.open("POST", url, false, login, password); http.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); http.send(params) If I try to log in I get: {"status":"nok","message":"Not JSON"} const XMLHttpRequest = require(

is there way to get and set token to local storage?

旧时模样 提交于 2020-01-16 14:54:07
问题 I'm writing e2e tests on http:localhost/ using protractor since we are only developing front-end app. I have to login into clients integration and manually copy token value from local storage and pass it to custom login method witch I created. Is there away to automate this login process? Any suggestion would be great So far I have tried window.localStorage.getItem() and window.localStorage.setItem() public static Login(): void { browser.get('login url'); browser.driver.findElement(by.id(