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

129
Vistas
"Undefined. Implement with the following snippet" protactor cucumber

Currently learning protractor, I am doing this parameter scenario where I want to the change the type of operation done in every run

my steps

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)
})

my feature file

@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|

? Then Select addition and go Undefined. Implement with the following snippet:

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

I am getting this message every time I run my code, I tried using regex because of this other question but it didn't fix anything, previously I was trying to use {string} and it didn't work out either

about 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

It was just missing something really 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