Skip to content

Instantly share code, notes, and snippets.

@NickBaynham
Created March 3, 2020 15:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NickBaynham/d27d575e1759fb18c909f250cd56a38a to your computer and use it in GitHub Desktop.
Save NickBaynham/d27d575e1759fb18c909f250cd56a38a to your computer and use it in GitHub Desktop.
Workflow using Page Objects for Registration Form
package selfHealingExamples.workflows;
import framework.pageObjects.RegistrationForm;
import org.openqa.selenium.WebDriver;
public class RegistrationWorkflow {
private WebDriver driver;
public RegistrationWorkflow(WebDriver driver) {
this.driver = driver;
}
public boolean completeRegistration(String firstName, String lastName, String username, String city, String state, String zip, boolean acceptTerms) {
RegistrationForm registrationForm = new RegistrationForm(driver);
registrationForm.goToPage();
registrationForm.enterFirstName("Ada");
registrationForm.enterLastName("Lovelace");
registrationForm.enterUsername("ALovelace");
registrationForm.enterCity("Orlando");
registrationForm.enterState("FL");
registrationForm.enterZip("32832");
registrationForm.clickAcceptTerms();
registrationForm.clickRegisterButton();
return (registrationForm.getTitle().equals("Self Healing Test Page"));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment