protractor

Organizing the test cases for 3 environment

蹲街弑〆低调 提交于 2019-12-24 07:06:41
问题 I am new to protractor. I have created my test cases for the development environment and it works fine. Now I have to move my test cases for the production and QA. Since the code in 3 environment is same I don't want to create duplicate code for all the 3 environment. In short If I run my code for development I should do protractor conf.js -dev for production protractor conf.js -production. -dev and -production are the respective url. Can anyone tell me a way I can achieve it? or should I

Failed: script timeout: result was not received in 11 seconds From: Task: Protractor.waitForAngular() - Locator: By(css selector, #my-btn)

让人想犯罪 __ 提交于 2019-12-24 06:49:42
问题 I'm trying to write some e2e test for my Angular application using Protractor. I have a simple html button having id=my-btn which I want to click, using: $('#my-btn').click(); Unfortunately I'm getting the following errors: Failed: script timeout: result was not received in 11 seconds From: Task: Protractor.waitForAngular() - Locator: By(css selector, #my-btn) (Session info: chrome=73.0.3683.75) (Driver info: chromedriver=2.46.628411 (3324f4c8be9ff2f70a05a30ebc72ffb013e1a71e),platform=Mac OS

Pass Jenkins build number to Protractor for SauceLabs

[亡魂溺海] 提交于 2019-12-24 06:38:35
问题 I am running protractor test cases through Jenkins, and using SauceLabs as execution environment. I am using Protractor-Cucumber-Framework. I want to pass build number from Jenkins so that I can pass same to SauceLabs to organize my test execution results. I tried params as mentioned in this post https://moduscreate.com/blog/protractor_parameters_adding_flexibility_automation_tests/ in Config.js params: { buildNumber:'xyz' } for running protractor : protractor config/config.js --parameters

How to read/write from/to an excel using NodeJS - Protractor?

二次信任 提交于 2019-12-24 05:35:26
问题 Might be a basic question. But since I am new to protractor, I definitely need some help! How to read/write from/to an excel using NodeJS - Protractor? Can someone explain with an example? My intention is to Parameterize my scripts using NodeJS - Protractor with the help of excel. 回答1: Protractor has no specific support for Excel itself, but it runs inside Node.JS, so you can use any Node module that works with excel. https://www.npmjs.org/package/excel-parser looks promising. 回答2: To perform

Protractor testing in iframe in other non-Angular application?

纵然是瞬间 提交于 2019-12-24 03:54:05
问题 My application is integrated with other site. That integration is established by clicking on the button. When I click on the button, pop-up shows with html that comes from another site. I show that content using this by putting URL in iframe. Url is from external site: <iframe class='' ng-src="{{url}}"></iframe> Can I execute my protractor test on elements on that pop-up? When I try to access to element on pop-up by ID, it says No such element found. I got IDs of elements by Firebug tool on

Delaying a response with $httpBackend

拥有回忆 提交于 2019-12-24 03:31:30
问题 In my view I have loading animation that is displayed until I receive a response from the API. //Displayed before we've received API response <p ng-if="vm.vehicles == null">Loading ...</p> //Displayed once we received response for the API <table ng-if="vm.vehicles"> <tr ng-repeat="vehicle.vm.vehicles">...</tr> To do my testing, I use the $httpBackend Angular module. Something like this: $httpBackend.whenGET('api/vehicles').respond({vehicles: [...]}); Problem I want to write a test to check

How to view request sent from node.js to server?

梦想与她 提交于 2019-12-24 02:42:56
问题 Regarding to this question: Transfer / pass cookies from one request to another in nodejs/protractor I got another one. How could I view complete request (headers + body) which I am performing via nodejs? 回答1: Yes, you can ... You can access the complete request from the full response body - response.request I have a generic full response structure illustrated below IncomingMessage ReadableState headers(ResponseHeaders) rawHeaders request - //This is what you need headers body body(Response

Protractor test on phantomjs with the use of selenium standalone jar,

為{幸葍}努か 提交于 2019-12-24 02:18:46
问题 I am trying to run protractor tests on phantomjs with the use of selenium-standalone-server.jar but it is giving me such error.I am running this in ubuntu 14.04. Here is my protractor-config.js file exports.config = { framework: 'cucumber', seleniumServerJar: 'node_modules/selenium-standalone/.selenium/2.43.1/server.jar', specs: [ 'specs/cucumber/*.feature' ], baseUrl: '', cucumberOpts: { format: 'pretty' }, capabilities: { browserName: 'phantomjs', 'phantomjs.binary.path': 'node_modules

Assign a value returned from a promise to a global variable

妖精的绣舞 提交于 2019-12-24 01:42:49
问题 I'm trying to read the browser memory values from Protractor and store them in a global object. To do that I'm getting the window.performance.memory object and then resolving the promise to inspect each of the memory values. The problem is that I cannot seem to be able to assign the value to a global variable. I've tried the following code, which doesn't seem to work quite well: this.measureMemory = function () { var HeapSizeLimit; browser.driver.executeScript(function () { return window

Build on TFS wants to copy a executable from Node.js test project

断了今生、忘了曾经 提交于 2019-12-24 01:38:23
问题 I created a Node.js project for an protractor test environment using the Node.js Tools to test a web application on a team foundation server. Locally i can create the test project and run it with the debugger. However, the build on the TFS does not work. Log: "<PATH>\TestProject.Web.Protractor.Tests.njsproj" (13) on node 2 (default targets). 13>PrepareForBuild: Creating directory "obj\Debug\". CoreCompile: Creating directory "bin". Copying file from "C:\Program Files (x86)\MSBuild\Microsoft