cucumberjs

each key must be a number of string; got function

拥有回忆 提交于 2019-12-11 17:53:11
问题 I have this scenario in Cucumber: Scenario Outline: Protractor and Cucumber Test InValid Given I have already...... When I fill the <number> .... Examples: | number|... | 3 |... |4 |... And I have this stepdefinition in a .js file: When('I fill the {int}',{timeout: 90 * 1000}, function(callback, number) { element(by.css("*[id='field_identificador']")).click(); element(by.css("*[id='field_identificador']")).sendKeys(number).then(callback); }); I am getting this error: each key must be a number

Get second event from FullCalendar by xpath

孤街浪徒 提交于 2019-12-11 16:07:48
问题 I have FullCalendar in my project: https://www.primefaces.org/primereact/#/fullcalendar I have 2 events at one day, I found first event by this code: //tbody//td[count(//thead//td[@data-date='2019-08-06']/preceding-sibling::*)+1] And I need to find second or more events. <table> <thead> <tr> <td data-date="2019-08-05"></td> <td data-date="2019-08-06"></td> <td data-date="2019-08-07"></td> <td data-date="2019-08-08"></td> //find index of this element <td data-date="2019-08-09"></td> </tr> <

Empty response in Protractor console.log

时光毁灭记忆、已成空白 提交于 2019-12-11 15:43:23
问题 I have done very basic script in protractor cucumber framework and use Chai and Chai as Promised as assert libraries. browser.get('http://www.angularjs.org'); var elm = element(by.id('the-basics')); elm.getText().then(function(txt) { console.log("txt: " + txt); }); But, I cannot see anything is written in terminal. I tried with xpath as well and get the same empty response. var elm = element(by.id('//h3[@id='the-basics']')); elm.getText().then(function(txt) { console.log("txt: " + txt); });

Cucumber Protractor times out after using then() on elements selected using Protractors element function

与世无争的帅哥 提交于 2019-12-11 14:58:32
问题 I have an issue which description matches perfectly with I am not able to identify elements using protractor in angular 2 application but for me the problem is not fixed by adding # before the id value Here is the code below: When('I select my input box', (callback) => { let inputbox = element(by.css('#roomWidthInput')); console.log('inputBox promise set'); var scrpt = "return document.getElementById('roomWidthInput');"; browser.executeScript(scrpt).then(function (text) { console.log('info',

How to setup the ignoreSynchronization when dealing with multiple browser instances in a signle test

我的梦境 提交于 2019-12-11 14:35:00
问题 I am trying to dealing with multiple browser instances in a single test.. once the action is done in one browser instance.. my script will open the new browser instance and for ignoresynchronization i wrote a one function but it is not working and even browserInstance.ignoreSynchronization=true also not working. can someone help me in this. Spec file this.Then(/^User tried to open in new browser instance$/,async function(){ browser2=await utility.openNewBrowser(browser); //this common

Check text in a DOM element using Protractor

℡╲_俬逩灬. 提交于 2019-12-11 02:57:54
问题 Here’s what I’m trying to do while testing an Angular app with Protractor. I would like to get a certain element, which is somewhat like this: <div class="someClass"> <p>{{textFromBoundModel}}</p> </div> then get its html, and check whether it contains the text that I expect it to have. I tried to get this element first by the cssContainingText method, but it didn't quite work (not sure why; maybe because the text within the paragraph is produced dynamically). So now I’m getting this element

How does one use Q.all with chai-as-promised?

回眸只為那壹抹淺笑 提交于 2019-12-10 21:43:10
问题 The chai-as-promised docs have the following example of dealing with multiple promises in the same test: it("should all be well", function (done) { Q.all([ promiseA.should.become("happy"), promiseB.should.eventually.have.property("fun times"), promiseC.should.be.rejectedWith(TypeError, "only joyful types are allowed") ]).should.notify(done); }); I assume that the Q here has come from npm install q and var Q = require('q'); . Where does .should come from? When I try this should is undefined

How can i set multiCapabilities dynamically in protractor config file

女生的网名这么多〃 提交于 2019-12-10 12:11:47
问题 I am using protractor 5.2.2. I have a requirement of setting multiCapabilities dynamically in protractor config file.Currently i have hard coded and set multiCapabilities as given below. multiCapabilities: [ { browserName: 'chrome', BatchNo:1 }, { browserName: 'chrome', BatchNo:2 }], i have a dynamic parameter called threads in beforeLaunch function.So depending on the value of this parameter, i have to set multiCapabilities dynamically and the BatchNo also.In above code i have threads=2, so

Cucumber-js: World constructor example with phantomjs

浪子不回头ぞ 提交于 2019-12-09 23:57:51
问题 In the cucumber-js page is showed an example with Zombie: // features/support/world.js var zombie = require('zombie'); var WorldConstructor = function WorldConstructor(callback) { var browser = new zombie(); var world = { browser: browser, // this.browser will be available in step definitions visit: function(url, callback) { // this.visit will be available in step definitions this.browser.visit(url, callback); } }; callback(world); // tell Cucumber we're finished and to use our world object

Tags Protractor + Jasmine to run set of suites

时光总嘲笑我的痴心妄想 提交于 2019-12-09 16:50:18
问题 I'm trying to figure out a way to use in the same way, or better said, similar way, the tagging options that cucumberJS has with protractor , but with Jasmin e, is there a way to tag the different scenarios, like: @smoke , @regression , etc.. and then tell on console to run with those? I'm declining to use Cucumber , since it's support it's seems to be getting flaky! Any help will be much appreciated! 回答1: With jasmine2 you can filter tests using a regular expression. Maybe you can add