protractor

Protractor test doesn't have test and assertion output and instead just has spec

送分小仙女□ 提交于 2020-01-03 17:04:02
问题 I'm trying to do the tutorial on the Protractor website here https://angular.github.io/protractor/#/ However, my output does not include 1 test, 3 assertions, 0 failures as expected. Instead it is: Using the selenium server at http://localhost:4444/wd/hub [launcher] Running 1 instances of WebDriver Started . 1 spec, 0 failures Finished in 12.273 seconds [launcher] 0 instance(s) of WebDriver still running [launcher] chrome #1 passed Config file: exports.config = { seleniumAddress: 'http:/

Protractor map function returning undefined

泪湿孤枕 提交于 2020-01-03 16:15:44
问题 Given an app with multiple widgets on it, each with their own title and whatnot, I would like to map each widget's elements, to make them easy to handle in tests. For example, a page: this.widgets = element.all(by.css('ul.widget-grid')).map(function(widget, index) { return { index: index, title: widget.element(by.css('div.title')).getText() }; }); And then in my spec: expect(page.widgets[0].index).toBe(0); expect(page.widgets[0].title).toBe('The Title'); Unfortunately, my expects are

How to take screenshot in protractor on failure of test cases

耗尽温柔 提交于 2020-01-03 08:32:27
问题 I am new to the protractor and would like to take screenshots of my failed test cases in browsers. Can you please help me out by advising how should I go about it? Thank you :) 回答1: You can use protractor-jasmine2-screenshot-reporter module for this, it has some good features which would serve your purpose. var HtmlScreenshotReporter = require('protractor-jasmine2-screenshot-reporter'); var reporter = new HtmlScreenshotReporter({ dest: 'target/screenshots', filename: 'my-report.html',

Unable to use protractor with chromedriver and selenium server directly

三世轮回 提交于 2020-01-03 05:52:21
问题 Recently I updated my protractor , webdriver-manager , chromedriver , selenium-server . After that I faced this problem: formerly we shared one protractor application in github with chromedriver and selenium-server in it. So others in my project can use it directly after downloaded this git project. We don't have seleniumAddress and directConnect in our protractor configuration file. It means we launched tests with local driver. But now update-config.json file was added to track chromedriver

Using multiCapabilities with protractor causes EADDRINUSE error

≡放荡痞女 提交于 2020-01-03 04:54:24
问题 I am using protractor to run my suite of test. If I use protractor's capabilities option, all the tests run fine on all three major browsers (firefox. chrome, safari) However, If I use multiCapabilities as such multiCapabilities: [{ 'browserName': 'firefox' }, { 'browserName': 'safari' }, { 'browserName': 'chrome' }], I get an EADDRINUSE error for two of them (not always the same) while the other one passes. How can I fix this: start of error message: PID: 87414 (capability: safari #2) Specs:

how to compare actual and expected values in angular js protractor

独自空忆成欢 提交于 2020-01-03 04:43:19
问题 In angular protractor automation,am trying to compare the values using "expect" but am not able to do it. In our application, after clicking on submit button the page is navigating to welcome page, so i want to get the expected value from the welcome page. This is the welcome page Html code <a class="link-btn ng-binding" title="new position" ng-click="openPositionModal($event)"><i class="icon-plus"></i> new position</a> please help me.. Thanks, Raghavendra 回答1: Just check if an element with

Testing out Protractor interactively

我怕爱的太早我们不能终老 提交于 2020-01-03 04:24:45
问题 I am trying to run the protractor interactively to test out the elments I start the selenium server by wedriver-manager start Then I go to protractor root directory C:\Users\Name\AppData\Roaming\npm\node_modules\protractor and type the following command "./bin/elementexplorer.js" http://some_server/someApp I get following errors Script Line : 1 Char : 1 Error : Invalid Character Code : 800A03F6 Source : MS JScript compliation error At line of elementexplorer.js is the following line #!/usr

Error: self signed certificate in certificate chain

百般思念 提交于 2020-01-03 04:13:45
问题 I can run the selenium server with fresh rebooting of my Windows 7. However if I kill the server and start it again, I will get this error. Sometimes doing webdriver-manager update--ignore_ssl may fix the problem, but most of time it won't fix. Any idea? I am running it on Windows 7 x64. C:\Users\...> webdriver-manager start --ignore_ssl events.js:163 throw er; // Unhandled 'error' event ^ Error: self signed certificate in certificate chain at TLSSocket.<anonymous> (_tls_wrap.js:1084:38) at

Protractor compare string numbers

萝らか妹 提交于 2020-01-03 03:09:09
问题 Today I've faced interesting problem of create test for pretty simple behavior: 'Most recent' sorting. All what test need to know: Every item have ID Previous ID is less then next in this case of sorting Approach : writing ID in to attribute of item, getting that id from first item with getAttribute() and either way for second. Problem : getAttribute() promise resulting with string value and Jasmine is not able to compare (from the box) string numbers. I would like to find elegant way to

Protractor Match Text

独自空忆成欢 提交于 2020-01-03 02:26:47
问题 How would I write a protractor function that will search the page for a string of text and return a state of whether or not that string of text is present on the page, visible, hidden, etc. The idea is to fulfill the step definitions for "I shall see" such that I can say "I shall see" for all visible elements, and "I should not see" for hidden elements" 来源: https://stackoverflow.com/questions/23791225/protractor-match-text