Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Leo Li
@yuxli066
do tags not work in cucumberJS in v5?
instead of TagExpression it is not Tags?
Leo Li
@yuxli066
Can someone please tell me what this is, for the life of me i cannot figure out but it started to appear in my spec report after I upgraded to v5
image.png
Ghost
@ghost~5d272f30d73408ce4fc5d0f4
hi all,
Is it possible to integrate galen with cucumber ?
if anyone done this, plz share the details...
Danilo Arantes
@d4niloArantes
Do you guys have suggestions for articles about the world.js??
Samuel Roldan
@sam3k
Hi all, question, I am wondering why, when I run cucumber in the CLI, it does not exit after it runs all the tests. Do i need to run something set something in the config?
Danilo Arantes
@d4niloArantes
Have you configured the "after method" into the hooks.js?
Samuel Roldan
@sam3k
No I have not. I’ve only configured the After method on cucumber.conf.js. Not sure if the same?
I see the this.driver.quit(); but it does not seem to apply for chromedriver
Leo Li
@yuxli066
Hi all, what reporting service do you guys use for cucumberJS in v5?
Leo Li
@yuxli066
Hi all, is anyone experiencing allure report issues with v5 cucumberJS?
Thomas G Henry
@ThomasGHenry
Hey, folks. My tests appear to run and pass, but cucumber never returns. I'm new to cucumber and the debugging doc is just a stub. Where should I begin to look to resolve this? I should point out that my tests use async/await in case that matters.
Thanks in advance
const { Given, When, Then } = require('cucumber');
const app = require('../../lib/app');
const request = require('supertest');

Given('server is running', function() {
  console.log('assume server is running');
});

When(
  'user posts to upload endpoint',
  { timeout: 1 * 60 * 1000 },
  async function() {
    await request(app)
      .post('/uploads')
      .set('Accept', 'application/json')
      .attach('photo', 'test/testimage.jpg')
      .expect(200);
  }
);

Then('image is downloadable', async function() {
  await request(app)
    .get('/uploads/testimage.jpg')
    .set('Accept', 'application/json')
    .expect(200);
});
app is an expressjs instance
Arkadiusz Buchholz
@arkbuchholz
hello, is it possible to fetch logins and passwords from external file? I don't like idea of hardcoding creentials...
Leo Li
@yuxli066
you can use the .env file to do what you want to do
Rahul Kuntoji
@Rahul-Kuntoji
Hello, I am not able to get the step description using the afterStep hook.
Kārlis Amoliņš
@kamolins
Heyo. I am unable to find anything in the docs about listening to cuke events. The only information I can find on the web is old aka defineSupportCode which is deprecated now. I am on v5.1.0 and using TS. Any pointers would be most welcome
Ghost
@ghost~5d272f30d73408ce4fc5d0f4
Hi… I have a doubt..
I’m running a scenario . in that i need to capture screen shot. but the file name should be like “<fetureName><ScenarioName><BrowserNAme>.png”
Is it possible to get all those details in a step definition ??
vinayak-prime
@vinayak-prime
Hi All, how to handle datepicker with selenium-webdriverjs?
vinayak-prime
@vinayak-prime
Hi, how to wait for element to load in webdriverjs?
const condition = until.elementLocated(by.css('html'))
        await driver.wait(async driver => condition.fn(driver), 10000, 'Loading failed.')

        // await driver.wait(until.elementIsVisible(outwardTravelDate), 10000);
        // let actualResult = await outwardTravelDate.getText();
        // assert.equal(actualResult, expectedText);
Avik Hazra
@avikhazra
Hi Any one using cucumber with cypress
Phil Chen
@icloudphil
anyone try the retry option in cucumber-js? cucumber/cucumber-js#727 did not see the change got merged into Master, any thought?
Phil Chen
@icloudphil
seems like cucumber v6 has the capability. answered my own question. :)
08fercho
@08fercho1_twitter
Hi All, I was looking for an example of dynamic data in cucumber tables, I googled it but couldn't find any good example of it in js. Just in case do you know some example I can use as a guide?
Vagner Silva
@VagnerSilva

When I use a skipped return function
The next function also gets skipped status as I add a skipped just on the desired function without affecting the next function?

Then ('', () => 'skipped')

Then ('', () => 'expect')
this function does not perform 'expect' instead returns 'skipped' too

nabeelkhalaf1121
@nabeelkhalaf1121
Hi all quick qustion for someone new in cypress with cucumber, dose the step definitions (Before, After, Given, When, Then) works syncronized specially Before and After
and if there is a good reference about this part would appreciate that
Leo Li
@yuxli066
does anyone here use Junit reports?
viktor-silakov
@viktor-silakov
How can I get feature name from hooks?
Leo Li
@yuxli066
you can do that in the before hook @viktor-silakov
viktor-silakov
@viktor-silakov
@yuxli066 I knew only how to get scenario name, this works fine but now I need to get feature name, it's real?
Martin
@Domorodec
Hello, is there anybody who uses decorators with cucumber-tsflow for cucumber tests?
Leo Li
@yuxli066
@viktor-silakov , there should be cucumberjs hooks made available for us to use I believe
that would allow us to grab the feature file names
SandeepNS12
@SandeepNS12
Can anyone let me know the solution for the below code, as I'm new to cucumber
     Then('it should click on more-vertical button', function () {
       // Write code here that turns the phrase above into concrete actions
       return 'pending';
     });
Ghouse Mohiddin
@PlaxoGhouse
@SandeepNS12 u have to add the code( what your script/code need perform) in the Step Definition
SandeepNS12
@SandeepNS12
@PlaxoGhouse I have written code.. I'm trying to click same button twice(means after doing some task, it should click on the same button) but itz not working, it is showing the above issue in the terminal
Ghouse Mohiddin
@PlaxoGhouse
@SandeepNS12 Did you place the code in the above step definition?
Ghost
@ghost~5d272f30d73408ce4fc5d0f4

hi,
I’m getting an error 'Unexpected identifier’ with "import printWord from '../support/action/printWord’;” …

Given.js

const { Given } = require('cucumber’);
import printWord from '../support/action/printWord’;
Given(/^I print the (\S+) word$/, printWord);

printWord.js

export default word => {
console.log('============' + word);
};

Can any one help me ???

Gėorges
@gmoussayan

Hello guys, Im new to Cucumber (and automation in general). I have the following online calculator https://www.online-calculator.com/full-screen-calculator/ which uses html5-canvas... I wrote the below code

`package stepDefinitions;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.interactions.Actions;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
import cucumber.api.java.en.Given;
import cucumber.api.java.en.Then;
import cucumber.api.java.en.When;
import org.junit.Assert;

public class subtractionStepDefinition {

WebDriver driver;    

@Given("^user is already on the full screen calculator Page$")
public void user_is_already_on_the_full_screen_calculator_Page() {

    System.setProperty("webdriver.gecko.driver", "//Users//gmoussayan//Documents//Selenium//geckodriver");
    driver = new FirefoxDriver();
    driver.get("https://www.online-calculator.com/full-screen-calculator/");

}

@When("^title of page is Full Screen Calculator - Online Calculator$")
public void title_of_page_is_Full_Screen_Calculator_Online_Calculator() {

    String title = driver.getTitle();
    System.out.println(title);
    Assert.assertEquals("Full Screen Calculator - Online Calculator", title);

}

@Then("^user maximize the browser$")
public void user_maximize_the_browser() {

    driver.manage().window().maximize();

}

@Then("^user clicks on number six$")
public void user_clicks_on_number_six() {

    new WebDriverWait(driver, 10).until(ExpectedConditions.frameToBeAvailableAndSwitchToIt(By.id("fullframe")));
    WebElement canvas = new WebDriverWait(driver, 10).until(ExpectedConditions.elementToBeClickable(By.id("canvas")));

    new Actions(driver).moveToElement(canvas, 20, 50).click().perform(); //6

}

@Then("^user clicks on number three$")
public void user_clicks_on_number_three() {

    new WebDriverWait(driver, 10).until(ExpectedConditions.frameToBeAvailableAndSwitchToIt(By.id("fullframe")));
    WebElement canvas = new WebDriverWait(driver, 10).until(ExpectedConditions.elementToBeClickable(By.id("canvas")));

    new Actions(driver).moveToElement(canvas, 20, 100).click().perform(); //3

}

@Then("^user clicks on the subtraction sign$")
public void user_clicks_on_the_subtraction_sign() {

    new WebDriverWait(driver, 10).until(ExpectedConditions.frameToBeAvailableAndSwitchToIt(By.id("fullframe")));
    WebElement canvas = new WebDriverWait(driver, 10).until(ExpectedConditions.elementToBeClickable(By.id("canvas")));

    new Actions(driver).moveToElement(canvas, 100, 100).click().perform(); // This is the Subtraction operation

}

@Then("^user clicks on the equal sign$")
public void user_clicks_on_the_equal_sign() {

    new WebDriverWait(driver, 10).until(ExpectedConditions.frameToBeAvailableAndSwitchToIt(By.id("fullframe")));
    WebElement canvas = new WebDriverWait(driver, 10).until(ExpectedConditions.elementToBeClickable(By.id("canvas")));

    new Actions(driver).moveToElement(canvas, 150, 200).click().perform(); //This is the equal (=) operation


}

}`

but im receiving the error Caused by: org.openqa.selenium.NoSuchElementException: Unable to locate element: #fullframe

This is happening because im using the below code under (as you see) all Gherkin keywords...

new WebDriverWait(driver, 10).until(ExpectedConditions.frameToBeAvailableAndSwitchToIt(By.id("fullframe"))); WebElement canvas = new WebDriverWait(driver, 10).until(ExpectedConditions.elementToBeClickable(By.id("canvas")));

So im wondering how can i set new WebDriverWait(driver, 10).until(ExpectedConditions.frameToBeAvailableAndSwitchToIt(By.id("fullframe"))); WebElement canvas = new WebDriverWait(driver, 10).until(ExpectedConditions.elementToBeClickable(By.id("canvas"))); to be readable by all Gherkin keywords without having to repeat it under each Gherkin keyword (which resulting on having it failing) - Im using Cucumber, Java and Selenium

any help would be highly appreciated. Thanks a lot :)
Ghost
@ghost~5d272f30d73408ce4fc5d0f4

Given(/^I open the (\S+) page$/, openWebSitenew.open(page));

is this snippest code is correct...