Skip to content

Instantly share code, notes, and snippets.

@NickBaynham
Created March 3, 2020 16:05
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/6320901fc74d94df7b4e8ee0bffdf9fb to your computer and use it in GitHub Desktop.
Save NickBaynham/6320901fc74d94df7b4e8ee0bffdf9fb to your computer and use it in GitHub Desktop.
A test of the registration form using Auto Discovery in Page Objects
package selfHealingExamples.tests.registration;
import framework.pageObjects.RegistrationFormAutoDiscovery;
import io.nickbaynham.automation.selfhealing.BrowserNotAvailableException;
import io.nickbaynham.automation.selfhealing.Tag;
import io.nickbaynham.automation.selfhealing.controllers.DocumentController;
import io.nickbaynham.automation.selfhealing.controllers.ElementNotFoundException;
import org.openqa.selenium.By;
import org.testng.annotations.Test;
import static org.testng.AssertJUnit.assertEquals;
public class RegistrationAutoDiscoveryPageObjectsTest extends BaseTest {
@Test
public void TestRegistrationPageObjectsWithAutoDiscovery() throws ElementNotFoundException, BrowserNotAvailableException {
RegistrationFormAutoDiscovery registration = new RegistrationFormAutoDiscovery(getDriver());
registration.goToPage();
registration.enterText("First Name", "Ada");
registration.enterText("Last Name", "Lovelace");
registration.enterText("Username", "AdaL");
registration.enterText("City", "Orlando");
registration.enterText("State", "FL");
registration.enterText("Zip", "32832");
registration.clickCheckBox("Accept Terms");
registration.clickButton("Register");
assertEquals("Self Healing Test Page", registration.getTitle());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment