protractor

Canonical way to e2e test angular UI grid

蹲街弑〆低调 提交于 2019-12-31 06:49:46
问题 The Story: Recently, our UI switched from custom tables to Angular UI grid as it got stabilized and feature-rich. The main Angular UI grid page claims to have "e2e testing integration", but we are having the hard time making this work. From what we understand, what they meant under "e2e testing integration" is the two helper files: gridTestUtils and gridObjectTestUtils. There are multiple problems with that: these two helper files are not a part of the angular-ui-grid module itself and are

promise chaining vs promise.all

限于喜欢 提交于 2019-12-31 05:34:10
问题 i have a task to enter the notification date using protractor where i need to clear contents before entering so i have came up with this code this.Then(/^I should enter "Notification Date"$/, () => { const d = new Date(); return orderCheckOutPage.pageElements.recipientNotificationDateMonth.clear().then(() => { return orderCheckOutPage.pageElements.recipientNotificationDateMonth.sendKeys(d.getMonth() + 1).then(() => { return orderCheckOutPage.pageElements.recipientNotificationDateDay.clear()

Storing global variable in a separate file for Protractor Tests

淺唱寂寞╮ 提交于 2019-12-31 04:02:26
问题 I am trying to create a separate inventory file for Protractor Test where I can store all the reusable variable to be used by different test scrips. The sample Variable list is called Vars.js and the specs should import the variables from this file and consume those. However, this fails as shown below. Can this approach actually be used for storing reusable variables? Can I actually create a separate inventory file for protractor tests outside of conf.js? Vars.js has the following content :

Increase the JavaStack heap memory for protractor

浪子不回头ぞ 提交于 2019-12-31 03:47:06
问题 I am running test cases using protractor, but sometimes I'm facing error FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory How can I increase the Javascript Heap size of protractor? I read about --max-old-space-size , buthow this parameter can be set in protractor? 回答1: If your Nodejs is v8.0.0 or later, you can set it by Environmen Variable: NODE_OPTIONS For linux: NODE_OPTIONS="--max-old-space-size=512" For windows: More detail look at here 回答2: set NODE

Failed: sendKeysToActiveElement error while invoking sendKeys to ENTER and other keystrokes using ChromeDriver Chrome with Protractor

╄→尐↘猪︶ㄣ 提交于 2019-12-31 03:19:09
问题 My Protractor tests that use sendKeys to press Enter or Tab failed today after I was auto-updated to Chrome 76. This worked find yesterday on Chrome 75. This is the code that used to work: browser.actions().sendKeys(protractor.Key.TAB).perform(); The error message is Failed: sendKeysToActiveElement Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53' System info: host: 'DESKTOP-6JGLC4V', ip: '192.168.0.5', os.name: 'Windows 10', os.arch: 'x86', os.version: '10

How i add text in a tag in e2e testing Angular Protractor

不羁的心 提交于 2019-12-30 14:24:51
问题 how i add content in tag for e2e testing in protractor <html lang="en" dir="ltr"> <head> <body class="cke_editable cke_editable_themed cke_contents_ltr cke_show_borders" contenteditable="true" spellcheck="true"> <p> <br type="_moz"> </p> </body> </html> i try this but this is not working var p = element(by.css('.cke_editable p')); p.sendKeys('This is a peragraph tag'); 回答1: First of all, it is the body that's editable in this case - send keys to it: var body = element(by.css('body.cke

How to find element by two attributes

烂漫一生 提交于 2019-12-30 13:12:30
问题 I have radio buttons like, how can I get the second one clicked finding first by ng-model then ng-value : <input type="radio" ng-model="vm.ist.educationVsInternship" ng-value=false /> <input type="radio" ng-model="vm.ist.educationVsInternship" ng-value=true /> I tried something like element(by.model('vm.ist.educationVsInternship')).all(by.css('[ng-value=true]')).click(); says and does not click any of them more than one element found for locator by.model("vm.ist.educationVsInternship") - the

How to find element by two attributes

…衆ロ難τιáo~ 提交于 2019-12-30 13:12:08
问题 I have radio buttons like, how can I get the second one clicked finding first by ng-model then ng-value : <input type="radio" ng-model="vm.ist.educationVsInternship" ng-value=false /> <input type="radio" ng-model="vm.ist.educationVsInternship" ng-value=true /> I tried something like element(by.model('vm.ist.educationVsInternship')).all(by.css('[ng-value=true]')).click(); says and does not click any of them more than one element found for locator by.model("vm.ist.educationVsInternship") - the

Protractor moves on to next test without waiting

大憨熊 提交于 2019-12-30 11:56:06
问题 I'm using protractor and when I run my tests on browserstack I receive the following error StaleElementReferenceError: stale element reference: element is not attached to the page document or depending on what I do in the beforeAll Error: Index out of bound. Trying to access element at index: 0, but there are only 0 elements that match locator By.cssSelector ... Here is the code snippet causing the error: describe('...', () => { it('...', () => { expect(element.all(by.css(...)).count()).toBe

Protractor Tests get Values of Table entries

眉间皱痕 提交于 2019-12-30 11:17:10
问题 I'm writing some protractor tests right now and got a little problem. How can I get the values of 'value1', 'value2' and 'value3' from the entry in the first row? The HTML looks like this: <table> <tr data-ng-repeat="object in $data track by object.id"> <td>{{object.value1}} </td> <td> {{object.value2}} </td> <td> {{object.value3}} </td> </tr> </table> 回答1: The protractor docs don't spell it out very clearly, but there is a .column() locator that applies to the by.repeater() locator. Some