Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

120
Views
"Indefinido. Implementar con el siguiente fragmento" protactor pepino

Actualmente estoy aprendiendo transportador, estoy haciendo este escenario de parámetros donde quiero cambiar el tipo de operación realizada en cada ejecución

mis pasos

 const { Given, Then } = require('cucumber'); const { browser } = require('protractor'); const {expect} = require('chai') Given("I open the {string} url", async function(url){ await browser.get(url) }) Then("The title of the website is {string}", async function(name){ const pageTitle = await browser.getTitle(); return expect(pageTitle).to.be.equal(name); }) Then("Wait {int} seconds", async function(timeInSeconds){ //element(by.model('first')).sendKeys(num) await browser.sleep(timeInSeconds * 1000) }) Then("with following variables {int} and {int}", async function(num1, num2){ await element(by.model('first')).sendKeys(num1); await element(by.model('second')).sendKeys(num2); }) Then('Select "(.*?)" and go', async function(op){ op.toUpperCase(); await element(by.model('operator')).element(by.css("option[value="+op+"]")).click(); await element(by.id('gobutton')).click() await browser.sleep(3000) //return expect(resultado).to.be.equal(res) })

mi archivo de características

 @smoke Feature: Home page validation Scenario Outline: Scenario Outline name: Page title Given I open the "https://juliemr.github.io/protractor-demo" url Then The title of the website is "Super Calculator" Then Wait 3 seconds Then with following variables <num1> and <num2> Then Select <operator> and go Examples: |num1|operator|num2|result| |7|addition|2|9| |2|division|2|4| |4|modulo|2|6| |3|multiplication|2|5| |5|substraction|2|7|

? Luego seleccione la adición y vaya a Indefinido. Implemente con el siguiente fragmento:

 Then('Select addition and go', function () { // Write code here that turns the phrase above into concrete actions return 'pending'; });

Recibo este mensaje cada vez que ejecuto mi código, intenté usar expresiones regulares debido a esta otra pregunta pero no solucionó nada, anteriormente estaba tratando de usar {string} y tampoco funcionó

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Solo faltaba algo realmente simple.

 Then Select "<operator>" and go
about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!