protractor

DRYing up protractor clicks tests using a For-Loops

房东的猫 提交于 2020-01-02 16:03:10
问题 Question: How do I click on every link in a ul > li a from one test? Problem: this test is passing; however, it isn't clicking on the links. I know this because It isn't redirecting or waiting 2000ms. Test: it("should have proper page linking to all footer link", function() { browser.driver.sleep(2000); browser.ignoreSynchronization = true; //creates an array of strings of all the menu items var titles = element.all(by.css('.leftMenu.first .submenu li a')) .map(function(elm) { return elm

Protractor for NodeJS on a virtual machine - How do I fix error 199?

安稳与你 提交于 2020-01-02 15:55:27
问题 I'm trying to use Protractor on a virtual machine and am getting the error code 199. I am following this tutorial with the exact same steps - http://www.protractortest.org/#/tutorial When I enter protractor conf.js on the command line, I get the following error: [14:51:31] I/hosted - Using the selenium server at (my url here) [14:51:31] I/launcher - Running 1 instances of WebDriver [14:51:51] E/launcher - null [14:51:51] E/launcher - WebDriverError: null at WebDriverError (/usr/local/lib/node

how to have protractor take over browser in the middle of an application

夙愿已清 提交于 2020-01-02 09:56:14
问题 I have written an angular project that utilizes require js, so most javascript will not be loaded prior to landing on a particular set of pages. (including angular.js) when writing flows, I had to use browser.driver in place of ptor, and this worked well until angular components came rolling in. Now I am trying to find a way to squeeze the initialization of ptor into the browser.driver and roll in the angular after a particular flow. So I have something like this browser.driver.getCurrentUrl(

how to have protractor take over browser in the middle of an application

扶醉桌前 提交于 2020-01-02 09:56:12
问题 I have written an angular project that utilizes require js, so most javascript will not be loaded prior to landing on a particular set of pages. (including angular.js) when writing flows, I had to use browser.driver in place of ptor, and this worked well until angular components came rolling in. Now I am trying to find a way to squeeze the initialization of ptor into the browser.driver and roll in the angular after a particular flow. So I have something like this browser.driver.getCurrentUrl(

Protractor configuration error w/ TypeScript + Angular 2

放肆的年华 提交于 2020-01-02 07:28:38
问题 I'm having problems getting Protractor to run in my project. It's having problems with my tsconfig.json file: { "compilerOptions": { "target": "es5", "module": "commonjs", "emitDecoratorMetadata": true, "experimentalDecorators": true, "sourceMap": true, "noEmitHelpers": true, "baseUrl": "./src", "paths": { "components": ["app/components"], "core": ["app/core"], "data": ["app/data"], "pages": ["app/pages"], "schemas": ["app/schemas"], "utility": ["app/utility"] } }, "exclude": [ "node_modules"

Protractor - get browser title as string

这一生的挚爱 提交于 2020-01-02 06:53:11
问题 I'd like to store initial device title, which is accessible via GUI in browser as page title, and reuse it later in the code. E.g. I want to change name of device if it is set to some particular name only, and to store an old device name in browser console log. Code might look like this: var some_name = 'Some Name'; var title = browser.getTitle(); console.log(title); if (title.equals('Some Name')){ some_name = 'Some Other Name'; } setDeviceName(some_name); unfortunately, to that protractor

Focus issues make tests failing

ε祈祈猫儿з 提交于 2020-01-02 05:18:46
问题 I'm using osx 10.9.2, protractor 0.21.0, selenium-server-standalone 2.40.0 and chromedriver 2.9. I'm having some problems, which (I believe) was due to window focusing issue. When I run my e2e test using protractor, the browser window would show but my terminal will still be the one in focus. This is apparent from "Terminal" was still shown in my menu bar rather than "Chrome" (osx behavior that indicates which app is in focus). I tried to remedy the situation by doing this to no avail:

e2e testing angularjs with protractor (protractor interactive mode brakes)

筅森魡賤 提交于 2020-01-02 04:29:09
问题 I am learning protractor for e2e testing angularjs and having some difficulties getting things going. Since I am new to this framework, Im following some tutorials like https://egghead.io/lessons/angularjs-protractor-interactive. watching the tutorial I see that he checks if an element has been successfully found by *tabbing . 0:56 during the tutorial, after he puts element(by.tagName("button")) and he presumably tabs to see further options available to the button found. he doesn't tell you

How do i supply “rootelement” option while testing protractor interatively

≯℡__Kan透↙ 提交于 2020-01-02 01:55:12
问题 When I execute node elementexplorer.js http://127.0.0.1:8080/app/view1 I get the following error: There was a webdriver error: Error Error while waiting for Protractor to sync with the page: "root element (body) has no injector. this may mean it is not inside ng-app." Please let me know how to provide the rootelement option. 回答1: At the moment, rootElement defaults to body. If you don't have your ng-app in the body, you will get that error. It can be set manually tho. You need to change the

Why must I use browser.sleep while writing protractor tests

隐身守侯 提交于 2020-01-02 00:17:08
问题 My first run at E2E tests. I'm trying to digest someone else's protractor tests. Problem: There are a lot of browser.driver.sleep and this seems fragile. Goal: not to use browser.driver.sleep Question: What is a better approach to browser.driver.sleep ? Something less fragile like a promise or something I dont know about lol? var config = require('../../protractor.conf.js').config; describe('this Homepage Body Tests', function(){ browser.driver.get(config.homepageUrl); it("should open find a