protractor

Why does chaining selectors in Protractor return false when using isPresent

馋奶兔 提交于 2019-12-23 03:22:11
问题 So I'm writing automation tests for Ionic 2/Angular 2 and I have DOM element that looks like this <ion-segment-button class="segment-button segment-activated" role="button" tappable="" value="orders" aria-pressed="true"> and I've created a page object that looks like this: ordersButton: element(by.css('[value="orders"]')), and in my spec file my test step looks like so expect((orders.header.ordersButton).element(by.css('.segment-activated')).isPresent()).toBeTruthy(); this returns false and I

Protractor - Scroll down and click

孤街醉人 提交于 2019-12-23 03:08:36
问题 I'm trying to simply scroll down in table and click on the element. This is function which I have: var scrollIntoView = function () { arguments[0].scrollIntoView(); } element.all(by.css('div.ui-grid-selection-row-header-buttons')).then(function(arr) { var row = arr[8]; browser.executeScript(scrollIntoView, row.getWebElement()).then(function () { row.click(); }); }); This script actually work and even scroll down, bproblem start when i use higher number (index) in arr[]; For example 8 work,

Multiple firefox profiles in protractor

倾然丶 夕夏残阳落幕 提交于 2019-12-23 03:07:26
问题 Following Configuring multiple capabilities with promises topic. Use case: I have two separate tests that require Firefox to be fired with javascript disabled and local storage disabled . Which means that I need two firefox profiles with javascript.enabled = false and dom.storage.enabled = false desired capabilities/preferences set. I'm using getMultiCapabilities() that was introduced in protractor 1.6. Till this moment, I needed only one custom firefox profile and it worked, here is the

protractor 'ElementNotVisibleError' on link with div inside

纵然是瞬间 提交于 2019-12-23 03:06:42
问题 I'm using AngularJS 1.2.2 and I'm trying to use protractor (version: 2.1.0) to click on a link by it's ID with the following spec; it 'allows adding levels', -> element(By.id("add_level")).click() If I use the test with the following I get an error <a id="add_level" ng-click="add_level()"><div class="secondary_btn">Add Level</div></a> ERROR: ElementNotVisibleError: element not visible (Session info: chrome=41.0.2272.89) (Driver info: chromedriver=2.15.322448

Eclipse Unable To Find Install Path Node Native

纵然是瞬间 提交于 2019-12-23 02:56:05
问题 I'm having the following issue debugging a sample javascript that interacts with an angular web application. What I'm trying to do is run the following demo script per the following url http://www.protractortest.org/#/ when I execute via the command line "protractor conf.js" it works as expected everytime. I follow this guide https://github.com/angelozerr/angularjs-eclipse/wiki/Protractor to execute via eclipse IDE however I can never debug the test script via the IDE. Eclipse always throw

Protractor waitForAngularEnabled

我的未来我决定 提交于 2019-12-23 02:52:35
问题 waitForAngularEnabled doesn't seem to work. Use case : - waitForAngularEnabled to false to get sso page and fill user/password fields - return to angular app and waitForAngularEnabled to true causes error i've create a simple angular app projet to reproduce it, simple run ng e2e https://github.com/lilletech/protractor-issue 回答1: You should break your tests up more, both for your sake with debugging and to mitigate issues with the protractor control flow. Changing your tests to the following

Protractor Multiple Size Browsers

六眼飞鱼酱① 提交于 2019-12-23 02:47:12
问题 So for a web app that I'm working on, I'm using Protractor JS to test it - I'm writing it in the mobile-first style, so resizing shouldn't be an issue. Is there a way to get it to tests multiple sizes without huge amounts of repeated code? Writing a test repeated multiple times different sizing using a browser.driver.manage().window().setSize(x, y); with multiple values of x and y seems pretty inefficient, but I'm not sure I can think of something better? 回答1: I would dynamically create tests

protractor: testing bootstrap alerts

不问归期 提交于 2019-12-23 02:31:38
问题 I'm new to Protractor testing. Been at it for only a few hours. I have an angular app, using bootstrap alerts. How do I test: Alert (danger-alert) is not present on page load Alert (danger-alert) becomes present on button click Alert (success-alert) becomes present on another button click Thanks! 回答1: Alert (danger-alert) is not present on page load You can use isPresent(): expect(element(by.css('.alert-danger')).isPresent()).toBe(false); Or, if the element is there but invisible, check

How to debug component/typescript code when running Protractor

喜欢而已 提交于 2019-12-23 02:25:16
问题 Most of the questions I've read so far only deal with trying to debug the unit tests / e2e tests when running Protractor / vscode (or rather how to make the breakpoints work in vscode) In my case, I'm able to place breakpoints in my e2e tests and vscode have no issues with them, but the problem, once I'm inside the it() function, I have no clue how to access/inspect my components I know e2e tests are not about components, but in this case, I was able to find a nasty bug that only e2e tests

Getting a specific element from an ElementArrayFinder giving me issues

半城伤御伤魂 提交于 2019-12-23 02:05:55
问题 This is a follow up question from Get a specific element from an ElementArrayFinder in protractor based on the text of getText() So, using the answer I was given, I used the .filter() method. It finds the row I want, but I get Failed: Index out of bound. Trying to access element at index: 0, but there are only 0 elements that match locator By(css selector, li) So, I put some logging into it. Here's my code: function getCardByName(name) { let cards = element.all(by.css(li)); cards.count().then