protractor

Node.js : Call function using value from callback or async

北战南征 提交于 2019-12-25 18:04:03
问题 I have written below .js file to call below defined function. objectRepositoryLoader.readObjectRepository() returns me a hashmap from where i have to use values in enterUserName(), enterPassword(), clickLoginButton() functions. var path = require('path'); var elementRepoMap = {} var LandingPage = function(){ var fileName = path.basename(module.filename, path.extname(module.filename)) objectRepositoryLoader.readObjectRepository(fileName+'.xml' , function(elementRepo){ console.log(elementRepo)

Cannot add new Given/When/Then, getting error `SyntaxError: Invalid regular expression: missing /`

て烟熏妆下的殇ゞ 提交于 2019-12-25 16:56:16
问题 I had configured cucumber + protractor, and I firstly was splitting stepDefinitions into different files like this: When I created new features files, and started running, cucumber/protractor did not recognized these new steps I was adding to the other files. So I decided to move all the new steps into the same file. But when I run, although they are well written (checked and compared thousands of times) I getting this error: [launcher] Error: /Users/brunosoko/Documents/Dev/Personal/test2

Drag and Drop not working using Protractor in HTML5 page

♀尐吖头ヾ 提交于 2019-12-25 16:45:02
问题 I have a scenario where i had to drag and drop the columns. However, i tried below commands but none of them are working browser.actions().mouseDown(elements).perform(); browser.actions().mouseMove({x:20, y:120}).perform(); browser.actions().mouseDown(elements).perform(); browser.actions().mouseMove({x:20, y:120}).perform(); browser.actions().mouseUp().perform(); browser.actions().dragAndDrop(elements,{x:20 , y:120}).mouseMove(elements).perform(); browser.actions().dragAndDrop(elements,a)

I am not able to identify elements using protractor in angular 2 application

淺唱寂寞╮ 提交于 2019-12-25 12:54:10
问题 Here is my html for angular 2 applications. I am executing my tests in chrome <md-card-title _ngcontent-c10="" class="ra-card-title mat-card-title"> <a _ngcontent-c10="">Massachusetts Division of Banks Issues Decision Establishing Limit on Maximum Allowable Fee for Dishonored Checks for State - Chartered Financial Institutions</a> </md-card-title> <div _ngcontent-c10="" class="ra-card-header__footer"> <md-card-subtitle _ngcontent-c10="" class="ra-card-code mat-card-subtitle">BLN3594</md-card

Multiple Step Definitions match error in Cucumber

霸气de小男生 提交于 2019-12-25 11:05:47
问题 I recently got started with Cucumber. I am trying to implement Cucumber+Protractor+TypeScript, using this link as the baseline. I am trying to follow this structure, C:. | ├───.circleci | ├───.vscode | ├───e2e │ ├───features | | |--sample.feature | | |--sample2.feature | | │ └───steps | | |--pageobject1_step.ts | | |--pageobject2_step.ts | | |--common_step.ts I have a simple feature inside both sample and sample2 feature files. However when I try running the tests, I get `Given I am on the

Multiple Step Definitions match error in Cucumber

只谈情不闲聊 提交于 2019-12-25 11:05:22
问题 I recently got started with Cucumber. I am trying to implement Cucumber+Protractor+TypeScript, using this link as the baseline. I am trying to follow this structure, C:. | ├───.circleci | ├───.vscode | ├───e2e │ ├───features | | |--sample.feature | | |--sample2.feature | | │ └───steps | | |--pageobject1_step.ts | | |--pageobject2_step.ts | | |--common_step.ts I have a simple feature inside both sample and sample2 feature files. However when I try running the tests, I get `Given I am on the

Trouble locating Angular element for Protractor UI Nav test

家住魔仙堡 提交于 2019-12-25 10:01:28
问题 I'm trying to select the third option in a dropdown list. Below are some details about the element: Outer HTML: <md-option _ngcontent-c6="" role="option" ng-reflect-value="last90Days" tabindex="0" id="md-option-2" aria-selected="false" aria-disabled="false" class="mat-option"><!--bindings={ "ng-reflect-ng-if": "false" }--> Last 90 Days <!--bindings={ "ng-reflect-ng-if": "true" }--><div class="mat-option-ripple mat-ripple" md-ripple="" ng-reflect-trigger="[object HTMLElement]"> </div> </md

Protractor: element.getText() returns an object but not String [duplicate]

断了今生、忘了曾经 提交于 2019-12-25 09:13:52
问题 This question already has answers here : Protractor: element.getText() returns an object and not String (3 answers) Closed 3 years ago . I have also checked link: Protractor: element.getText() returns an object and not String but i found no answer for that on above link and i want string in return?? 回答1: All the protractor's methods return promises, to resolve that promise you need to send something like this: element.getText().then(function(text) { console.log(text); }); or use "expect"--

Protractor throws error an X Display is required for headless chrome 59

血红的双手。 提交于 2019-12-25 08:42:19
问题 While running ng e2e I get the following ✓ should display message saying sign up ✗ should be able to sign up with a valid user - Failed: unknown error: an X display is required for keycode conversions, consider using Xvfb (Session info: headless chrome=59.0.3071.71) (Driver info: chromedriver=2.29.461571 (8a88bbe0775e2a23afda0ceaf2ef7ee74e822cc5),platform=Linux 3.13.0-48-generic x86_64) (Session info: headless chrome=59.0.3071.71) (Driver info: chromedriver=2.29.461571

Using ngMock for backend-less testing an external site

只谈情不闲聊 提交于 2019-12-25 08:32:33
问题 Is there a way to use angular-mocks.js to invoke backend-less request mocking, testing an external site ? There are plenty of examples using angular mocks on a codebase that the developer has access to add a . However, I'm stuck in a scenario... calling out to an Angular site, in the wild, which I need to test the frontend functionality, with well-known endpoints/results. A quick fake example: Call out to www.externalwebsite.com/RealAngularApp RealAngularApp calls an endpoint www