end-to-end

protractor unknown error, removing attribute from DOM

荒凉一梦 提交于 2019-12-01 11:09:59
Im new to protractor and trying to remove attribute from DOM but getting "unknown error", Im not sure what could be the problem Im having a simple HTML with a custom directive.I am trying to remove that for my test cases to pass: <input type="text" name="rptdate" input-date placeholder="DD-MM-YYYY" data-ng-model="newPatReports.reportDate" /> Commands I ran are: browser.executeScript( 'document.getElementsByName("rptdate").removeAttribute("input-date")' ); browser.driver.findElement(protractor.By.name('rptdate')).removeAttr("input-date"); browser.executeScript('document.querySelector("input

Custom message on wait timeout error

寵の児 提交于 2019-12-01 11:03:10
From time to time I'm using "Expected Conditions" feature introduced in protractor 1.7. Use case : var EC = protractor.ExpectedConditions; browser.wait(EC.visibilityOf(header.displayName), 10000); where header is a Page Object. If header.displayName would not become visible in 10 seconds, an error would be thrown: [firefox #4] 2) Describe description here [firefox #4] Message: [firefox #4] Error: Wait timed out after 10082ms [firefox #4] Stacktrace: [firefox #4] Error: Wait timed out after 10082ms [firefox #4] ==== async task ==== [firefox #4] at [object Object].<anonymous> (/Path/to/project

protractor unknown error, removing attribute from DOM

放肆的年华 提交于 2019-12-01 08:42:17
问题 Im new to protractor and trying to remove attribute from DOM but getting "unknown error", Im not sure what could be the problem Im having a simple HTML with a custom directive.I am trying to remove that for my test cases to pass: <input type="text" name="rptdate" input-date placeholder="DD-MM-YYYY" data-ng-model="newPatReports.reportDate" /> Commands I ran are: browser.executeScript( 'document.getElementsByName("rptdate").removeAttribute("input-date")' ); browser.driver.findElement(protractor

Custom message on wait timeout error

喜夏-厌秋 提交于 2019-12-01 08:34:41
问题 From time to time I'm using "Expected Conditions" feature introduced in protractor 1.7. Use case : var EC = protractor.ExpectedConditions; browser.wait(EC.visibilityOf(header.displayName), 10000); where header is a Page Object. If header.displayName would not become visible in 10 seconds, an error would be thrown: [firefox #4] 2) Describe description here [firefox #4] Message: [firefox #4] Error: Wait timed out after 10082ms [firefox #4] Stacktrace: [firefox #4] Error: Wait timed out after

What line is causing this Protractor error?

我的梦境 提交于 2019-12-01 05:51:28
Is there a way for Protractor to show in the console log what line the error occurred on? I just get this type of message: Message: Failed: Cannot call method 'click' of undefined Stack: Error: Failed: Cannot call method 'click' of undefined at /usr/local/lib/node_modules/protractor/node_modules/jasminewd2/index.js:104:16 at /usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/goog/base.js:1582:15 at [object Object].webdriver.promise.ControlFlow.runInNewFrame_ (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/promise.js:1654:20) at

AngularJs Protractor: Element in slide out menu not visible

两盒软妹~` 提交于 2019-12-01 00:09:33
I'm back with more Protractor Q&A. So, I am coming across an issue when trying for find an element that is inside a slide out menu. Snippet of html: <div class="ng-scope" ui-view="navmenu"> <nav class="menu slide-menu-left ng-scope"> <md-content class="md-default-theme" style="display: table" ng-click="slideMenuLeft()" tabindex="0"> <button class="md-button md-default-theme" ng-transclude="" style="width:50%;height:72px;border-right:1px solid #ddd;border-bottom:1px solid #ddd" ng-click="checkmap()" tabindex="0"> Here are the ways I have tried to grab the the button out of this menu: element(by

Is it possible to get next sibling using cssContainingText in Protractor

与世无争的帅哥 提交于 2019-11-30 21:13:18
Is it possible to get the next sibling by using by.cssContainingText() Example: HTML code is like below: <div ng-repeat="SomeNgRepeat" class="ng-scope"> <div class="text-label" >SomeText</div> <div class="some-class">SomeValue</div> </div> Get element by using: element(by.cssContainingText('div.text-label','SomeText')) Now find the next sibling of the above element. I know of css=form input.username + input way of finding the sibling. However, this is not working in my case! I think 'chaining' can be used to achieve this, but don't know How! Thanks, Sakshi What if you would get it in one go

Is it possible to get next sibling using cssContainingText in Protractor

大兔子大兔子 提交于 2019-11-30 17:08:21
问题 Is it possible to get the next sibling by using by.cssContainingText() Example: HTML code is like below: <div ng-repeat="SomeNgRepeat" class="ng-scope"> <div class="text-label" >SomeText</div> <div class="some-class">SomeValue</div> </div> Get element by using: element(by.cssContainingText('div.text-label','SomeText')) Now find the next sibling of the above element. I know of css=form input.username + input way of finding the sibling. However, this is not working in my case! I think 'chaining

Protractor - count elements in repeater and print it

倖福魔咒の 提交于 2019-11-30 16:27:50
问题 I'm trying to count the elements in repeater and to print it to console. This is the markup: <div class="col-md-3 ng-scope" ng-repeat="app in userApps" >...< /div> currently I'm counting and comparing: expect(element.all(by.repeater('app in userApps')).count()).toEqual(4); it works, but I want to be able to print it also. I've tried this: var rows = element.all(by.repeater("app in userApps")); var sum = rows.count(); console.log(sum.getText()); but I'm getting: TypeError: Object [object

Testing link style changes

冷暖自知 提交于 2019-11-30 16:04:26
In one of our tests, we are testing the link ( a element) style changes after a mouse over . By default, the link has a black font without decoration, but on mouse over the font changes to blue and the link text becomes underlined. Here is the relevant test: it("should change font style on mouse over", function () { expect(scope.page.forgotPassword.getCssValue("color")).toEqual("rgba(11, 51, 60, 1)"); expect(scope.page.forgotPassword.getCssValue("text-decoration")).toEqual("none"); browser.actions().mouseMove(scope.page.forgotPassword).perform(); expect(scope.page.forgotPassword.getCssValue(