end-to-end

Check POST request payload data with Protractor

若如初见. 提交于 2019-12-05 01:49:36
问题 Let's say i have angular page with a couple of input elements and save button. After Save button is clicked POST request will be sent. I'm writing Protractor e2e test for this page. The question: How can i check with protractor POST request payload data after app is sent it or before sending? I want to be sure that my app will sent right data in POST request. 回答1: Following @Andres D's comment: yes, there is a misconception here. protractor is a tool that helps you mimic real-user

How can I do a Ctrl+Click on protractor?

无人久伴 提交于 2019-12-05 00:49:16
问题 I have tried weird combination as the following, but none of them are working: var ptor = protractor.getInstance(); ptor.actions().mouseMove(node).keyDown(ptor.Key.CTRL).sendKeys(ptor.Key.CLICK).perform(); 回答1: You need to chain mouseMove() , keyDown() and click() : var elm = element(by.id('my_id')); browser.actions() .mouseMove(elm) .keyDown(protractor.Key.CONTROL) // COMMAND for Mac .click() .perform(); Tested it on Chrome by clicking on a link - opens up a link in a new tab. Note that,

Protractor + Hybrid Angular 1+2 Application = Fail

旧巷老猫 提交于 2019-12-04 23:56:57
问题 Protractor works well on Angular 1 but after upgrading my app to an hybrid Angular 1+2 I get this error: Failed: Error while waiting for Protractor to sync with the page: "[ng:test] no injector found for element argument to getTestability http://errors.angularjs.org/1.4.9/ng/test" It seems a common error when you don't have a ng-app tag <div ng-app=myAppManager"> in your Angular 1 app and can be easily fixed wiyh rootElement : 'html' in your protractor config file but it doesn't seem to

Couldn't run protractor scripts on Android emulator

隐身守侯 提交于 2019-12-04 20:09:59
I want to execute protractor script on android emulator using Appium, but the problem emulator isn't launched when i tap: " protractor conf.js " on terminal. The test is passed in chrome browser of windows instead of browser in the emulator. Shall i add other capabilities ? or i should change the base url ? // An example configuration file. exports.config = { seleniumAddress: 'http://localhost:4733/wd/hub', specs: ['todo-spec.js'], directConnect: true, // Capabilities to be passed to the webdriver instance. capabilities: { 'browserName': 'chrome', 'device': 'android', 'deviceName' : '5554

Output plugins used by protractor

大憨熊 提交于 2019-12-04 19:15:39
Protractor 2.0.0. introduces this neat idea of extending protractor with plugins offering several built-in plugins, like ngHint , console or timeline . Currently, I'm trying to make the timeline plugin work and I'd like to see a more verbose output on the console in order to debug the problem. Is it possible to see on the console what plugins are loaded by protractor ? FYI, created an issue: Protractor to report loaded plugins . No, I did not find something in the code of the plugins.js . If I run Protractor tests with enabled plugins, on the console I only see the result output of a plugins

How to find and click a table element by text using Protractor?

 ̄綄美尐妖づ 提交于 2019-12-04 13:40:52
<tr id="item" ng-repeat="item in itemList> <td id="code" ng-repeat="column in columns">Some Text</td> </tr> I've seen some other similar questions but I couldn't solve it yet. Thats what I've tried so far: element.all(by.repeater('column in columns')).findElement(by.id('code')).getText('Some Text').click(); EDIT: <tr ng-repeat="item in items> <td>{{item.name}}</td> <td>{{item.description}}</td> </tr> Which results in: <tr> <td>Some Name</td> <td>Some Text</td> </tr> <tr> <td>More Name</td> <td>More Text</td> </tr> etc etc You need to filter() the desired element: var columns = element.all(by

onCleanUp() vs onComplete() vs afterLaunch()

我的梦境 提交于 2019-12-04 12:43:22
In Protractor, there is a "global set up" method called onPrepare() , but I'm not completely sure what is meant to be a "global tear down" - there are three relevant methods: onCleanUp , onComplete and afterLaunch that are all called after a test execution. Why does protractor have three methods called after a test run? What is the difference between onCleanUp , onComplete and afterLaunch ? I've also noticed that there is an "exit" event that we can attach a callback to ( example here ): protractor.on('exit', function (status) { }); Johan Karlsson onComplete will be executed once per

Protractor expected condition for element containing any text

可紊 提交于 2019-12-04 11:54:39
Is there a way how to check whether an element has any text in it? I already found textToBePresentInElement but this function checks for specified value and does not return a proper error if it fails. I'm population the element via API and it's loaded bit later, so I want the browser to wait till any information appears in the element and then check for correct value. Alternatively it would be also very helpful to manage to get a specific error message when EC fails: browser.wait(EC.textToBePresentInElement(element(by.binding('myvar')), "expected"), 5000); alecxe The third argument to browser

Protractor - find element in iframe

ⅰ亾dé卋堺 提交于 2019-12-04 11:26:26
in very top of my page I have call of iframe: <iframe ng-if="webpadUrl" id="webPadIframe" ng-src="http://Path/To/iFrame?sessionId=9bc9989441c8c9cfb9ff5bdc381a72ea" seamless="seamless" class="fullscreen ng-scope" src="http://Path/To/iFrame?sessionId=9bc9989441c8c9cfb9ff5bdc381a72ea"> </iframe> Inside of iframe I have something like: <svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 5845 3897"> and below that multiple <g> with different ID and so on.. <g id="30_0_80" transform="translate(420,754)" class=""> <path class="fp x80 xab active" d="M307 0 L293 15 L155 120 L87 181 L47

How to select element in Protractor by html attribute when value contains

寵の児 提交于 2019-12-04 10:49:32
Struggling with how to select an element that doesn't have a standard unique id or class. How would I select this input element with Protractor? Note: I cannot use the class ComboBoxInput_Default class, as this drop down box is used on several other page elements. There also isn't any easily identifiable parent element for at least 10+ DOM levels. <div style="display:inline; white-space: nowrap;" id="ctl00_ctl31_g_b56afa08_7869_450c_8871_f6759a89d9b1_ctl00_WPQ3txtFields_ddPositioList_10_Solution_MultiComboSelection" class="ComboBox_Default"> <input type="text" style="width: 133px; height: 15px