package com.epam.rft.atsy.cucumber.util;

import static com.epam.rft.atsy.cucumber.util.DriverProvider.getDriver;

import org.openqa.selenium.By;

import cucumber.api.java.en.Given;

public class CommonStepDefs {

  @Given("The user signed in")
  public void loggedIn() {
    getDriver().get("http://localhost:8080/atsy/login?locale=hu");
    getDriver().findElement(By.id("name")).sendKeys("test");
    getDriver().findElement(By.id("password")).sendKeys("pass3");
    getDriver().findElement(By.id("loginButton")).click();
  }
}

@@ -106,16 +106,99 @@
 tDriver;
+%0Aimport static com.epam.rft.atsy.cucumber.util.DriverProvider.waitForPageLoadAfter;
 %0A%0Aimport
@@ -541,24 +541,54 @@
 pass3%22);%0A   
+ waitForPageLoadAfter(event -%3E
  getDriver()
@@ -629,16 +629,17 @@
 .click()
+)
 ;%0A  %7D%0A%7D%0A

Add wait for page load condition when user signs in