protractor

Implement async/await in sort function of arrays javascript

旧巷老猫 提交于 2019-12-22 05:41:04
问题 I am trying to implement a sort method on protractor ElementArrayFinder . As known, all protractor methods return promises. So my sort method has a condition which depends on promises resolution. I am using a node plugin for async/await in order to make it compatible with node.js versions lower than 6. (Here the plugin: https://www.npmjs.com/package/asyncawait) Here my code, where this is the ArrayElementFinder : var asyncCompare = async(function(a, b) { let x = await (a.getText()); let y =

Testing Angularjs Application with Selenium

丶灬走出姿态 提交于 2019-12-22 05:09:30
问题 I am testing an angular js application Link Angular js App when i click on the UI Kit link on the web application i am getting the following error - at demoaj.Ajapp.main(Ajapp.java:16) Caused by: org.openqa.selenium.NoSuchElementException: Unable to locate element: {"method":"xpath","selector":"html/body/div1/div1/aside/div/div/ul/li[2]/a"} Command duration or timeout: 51 milliseconds For documentation on this error, please visit: http://seleniumhq.org/exceptions/no_such_element.html I am new

Protractor:How to remove extra space from string just like we use in java getText.trim()

南笙酒味 提交于 2019-12-22 05:09:27
问题 How to remove extra space from string just like we use in java getText.trim() in Protractor , I used like this: var columnvalue=rows.get(9).getText(); var columnvalue1=columnvalue.trim(); but i got error: Object [object Object] has no method 'trim' 回答1: Andreas' solution is basically correct. I'm just appending some additional info. I'm not sure what you're using the trim for, but 1) if you're trying to put it into an assertion: expect(rows.get(9).getText()).toMatch('\s*STRING_TO_MATCH\s*')

Customize the protractor test report/output

你说的曾经没有我的故事 提交于 2019-12-22 04:46:18
问题 Hi I'm trying to get the protractor test results in a file by giving the following command in command prompt. protractor conf.js > location\result.txt where I could see the complete output of the protractor test. Can I get just the number of Specs executed and failures in a txt file after running the protractor tests in a customized way? I need my report in this customized way as I need to run a shell script if all the protractor tests are passed. 回答1: We have two ways to fulfill your

Protractor webdriver-manager chromedriver update

拥有回忆 提交于 2019-12-22 04:34:10
问题 There seems to be a issue with chromedriver 2.2 and the newest version of Chrome. This issue has to deal with the protractor not being able to send tab keys with 2.2. If I do webdriver-manager update, it does not update to the chromedriver 2.4. I did a hack where I downloaded chromedriver 2.4 exe myself and manually put it in the selenium folder, but that is not the best way to do this. How do you update protractor to use the latest version of Chromedriver 2.4? 回答1: I am having the same issue

Protractor wait command is not able to wait for the bootstrap modal to appear

那年仲夏 提交于 2019-12-22 04:18:27
问题 Scenario: Whenever user sign in using incorrect credentials, a bootstrap modal appears for 1-2 second with message "sorry, incorrect credentials". Below is the HTML of the modal. <div class="modal-content"> <div class="modal-body note-error text-center ng-binding"> Sorry, invalid credentials! </div> </div> I need to verify if the expected error text is equal to actual error text. My code PageObject.js var errorModal = element(by.css('.modal-body.note-error.text-center.ng-binding')); this

Chrome: fake microphone input for test purpose

南楼画角 提交于 2019-12-22 04:18:18
问题 For testing purpose with protractor, I need to simulate audio input from the microphone on a computer without microphone. With the "--use-fake-device-for-media-stream" flag, Chrome can simulate a fake microphone. However, no input is coming from the fake microphone so my tests fails. Is it possible to simulate sound getting out of the microphone ? Thanks ! 回答1: I get fake video and microphone input using two chrome flags --use-fake-device-for-media-stream --use-fake-ui-for-media-stream Try

Protractor error Angular could not be found on the page

故事扮演 提交于 2019-12-22 03:48:06
问题 I'm trying to set up End-2-End testing for my Angular (1.4) site using protractor (2.1.0). Jasmine is installed and unit tests are working fine. When I run protractor the index#/login page loads in a browser window but no code runs and protractor reports this error Failed: Angular could not be found on the page http://localhost/SpectrumGMWeb/index.html#/login : retries looking for angular exceeded My protractor config looks like this exports.config = { allScriptsTimeout: 11000,

Is it possible to send a reason for Jasmine 2 specs skipped with xit or pending()?

大兔子大兔子 提交于 2019-12-22 01:41:02
问题 When we find a bug with one of our Protractor Jasmine2 specs, we usually want to skip the test until the bug has been resolved. I know how to do this with xit or pending() , and JasmineReporters TerminalReporter is doing a nice job of color highlighting and listing pending specs. However, the pending tests always report No reason given , which implies it is possible to give a reason for the skipped test. I currently comment the spec with an issue number, but it would be really nice to report

How to modify protractor html screenshot reporter to show report for each “expect” (assertion ) instead of each “it” block in spec file

坚强是说给别人听的谎言 提交于 2019-12-22 01:29:40
问题 I have 3 'it' specs with 27 expects in the code. protractor-html-screenshot-reporter includes 'it' specs but not expect level results. Please let me know, can i make any configuration changes to make it work. Thanks, Arpit Jain 回答1: protractor-html-screenshot-reporter works on the spec-level ( it blocks). According to the source code, it defines the reportSpecResults function which is called by jasmine when the reporting results for a spec run. 回答2: The below code takes a screenshot on each