Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

119
Vistas
"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 Respuestas
Responde la pregunta

0

Solo faltaba algo realmente simple.

 Then Select "<operator>" and go
about 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda