end-to-end

Protractor get element by model in repeater array

假如想象 提交于 2020-01-16 05:20:32
问题 For example, in HTML page: <tr ng-repeat="post in posts"> <td ng-click="activePost(post)" class="title">{{post.title}}</td> <td><button class="btn btn-danger" ng-click="delete(post)">Delete</button></td> <td><input type="checkbox" ng-model="post.active" id="{{post.id}}" /></td> </tr> Then, I want something like: element.all(by.repeater('post in posts')).then(function(posts) { var activePost = posts[0].element(by.model('active')); expect(activePost).toEqual(true); }); This returns an unable to

Do I need a unit-testing framework if I'm already using Cypress in a Vue.js app?

扶醉桌前 提交于 2020-01-14 09:21:10
问题 When scaffolding a new project with the Vue.js CLI, it offers a choice of both unit-testing and E2E-testing frameworks. Unit-testing functionality is perfectly adequate in Cypress. My question, then: is there an advantage to using a distinct unit-testing framework if I'm already using Cypress? 回答1: There is a third-party adapter made by a Cypress contributor here called cypress-vue-unit-test(along with unit-test adapters for other popular frameworks). You should check that out and see if it

Karate vs Spock

不问归期 提交于 2020-01-13 18:58:50
问题 I've recently found Karate framework for testing Web Services. But there is also Spock framework providing similar ( to my mind ) functionality. What are the differences between the frameworks? I would like to suggest our testers to take a look at it. 回答1: Developer of Karate here. I have only read about Spock but here's my PoV. Karate is laser-focused on testing HTTP web-services, and therefore is designed to manipulate and perform assertions on JSON and XML. As a result - you do not need

Protractor : Read Table contents

坚强是说给别人听的谎言 提交于 2020-01-09 10:49:10
问题 I've been writing e2e tests for my angular js app and am unable to figure this out. I've got a table with data in it. I want to extract the first rows data. <table> <tr> <td><\td> <td><\td> <td><\td> </tr> </table> I did this in protractors elementExplorer and it prints out the values of all 3 columns element.all(by.repeater('item in items.list')).get(0).getText() James Byrne 1 If I do this, it prints out the first column value element.all(by.repeater('item in items.list')).get(0).element(by

clicking button using executescript in protractor - POM

自古美人都是妖i 提交于 2020-01-05 05:00:34
问题 I have to click a button and since it is not clicking directly, i am using the below code and it is working. var create = element(by.css('button[title="Add Master Obligation"]')) browser.executeScript("arguments[0].scrollIntoView();arguments[1].click();", create, create); I want to put the same for page object model in protractor. So, i have added like this. page.ts: var mo = function () { this.createbutton = function () { var create = element(by.css('button[title="Add Master Obligation"]'))

How to restore database before executing test in protractor

元气小坏坏 提交于 2020-01-04 02:48:08
问题 I have written E2E tests in Protractor which uses node to run through webdriver. Now I have some inserts tests which will insert the data and create user. Now if I run the case for the first time it will pass but when I will rerun the test it will fail as it will already present. Expected : I need to restore my MSSQL DB when ever the tests in protractor start. Present : I am doing manually by restoring the test. Is there any way that I can restore the DB through protractor or Node ? 回答1: This

How do i supply “rootelement” option while testing protractor interatively

≯℡__Kan透↙ 提交于 2020-01-02 01:55:12
问题 When I execute node elementexplorer.js http://127.0.0.1:8080/app/view1 I get the following error: There was a webdriver error: Error Error while waiting for Protractor to sync with the page: "root element (body) has no injector. this may mean it is not inside ng-app." Please let me know how to provide the rootelement option. 回答1: At the moment, rootElement defaults to body. If you don't have your ng-app in the body, you will get that error. It can be set manually tho. You need to change the

What line is causing this Protractor error?

一个人想着一个人 提交于 2019-12-30 09:41:48
问题 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

Element is not clickable at point - Protractor

风流意气都作罢 提交于 2019-12-23 07:49:27
问题 I'm getting an error that element I am trying to click on is not click able which I belieave is not true. My error looks: 1) Open VehiclePage and populate data Populate vehicle data Message: UnknownError: unknown error: Element is not clickable at point (1315, 371). Other element would receive the click: <div class="form-con rol combo-options ng-scope ng-animate ng-leave ng-leave-active" ng-if="comboBox.visible" on-click-outside="comboBox.hide">...</div> (Session info: chrome=39.0.2171.71)

How to check checkbox in repeater with protractor

僤鯓⒐⒋嵵緔 提交于 2019-12-23 04:03:53
问题 I am having difficulty checking a checkbox in an AngularJs repeater with protractor. The model looks like this: environments: [ { name: 'Proof of Concept', checked: false }, { name: 'Non-Production', checked: false }, { name: 'Production', checked: false } ] The view like this: <div class="checkbox" ng-repeat="environment in vm.assessment.environments"> <label><input type="checkbox" ng-model="vm.assessment.environments[$index].checked" ng-click="vm.checkboxChanged()" ng-required="!vm