-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
230c0fa
commit 3ff0abf
Showing
1 changed file
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import org.junit.jupiter.api.Assertions.assertEquals | ||
import org.junit.jupiter.api.Test | ||
import src.demoqa.pages.RegistrationFormPage | ||
import src.demoqa.utils.FakerUtil | ||
|
||
class RegistrationFormTest : BaseTest() { | ||
@Test | ||
fun testFirstNameAndLastName() { | ||
val firstName = FakerUtil.generateName() | ||
val lastName = FakerUtil.generateLastName() | ||
val registrationFormPage = RegistrationFormPage(page) | ||
|
||
registrationFormPage.enterFirstName(firstName) | ||
registrationFormPage.enterLastName(lastName) | ||
|
||
assertEquals(firstName, registrationFormPage.getFirstNameValue()) | ||
assertEquals(lastName, registrationFormPage.getLastNameValue()) | ||
} | ||
|
||
@Test | ||
fun testEmail() { | ||
val email = FakerUtil.generateEmail() | ||
val registrationFormPage = RegistrationFormPage(page) | ||
|
||
registrationFormPage.enterEmail(email) | ||
|
||
assertEquals(email, registrationFormPage.getEmailValue()) | ||
} | ||
|
||
@Test | ||
fun testPhoneNumber() { | ||
val phoneNumber = FakerUtil.generatePhoneNumber() | ||
val registrationFormPage = RegistrationFormPage(page) | ||
|
||
registrationFormPage.enterPhoneNumber(phoneNumber) | ||
|
||
assertEquals(phoneNumber, registrationFormPage.getPhoneNumberValue()) | ||
} | ||
|
||
@Test | ||
fun testCurrentAddress() { | ||
val currentAddress = FakerUtil.generateCurrentAddress() | ||
val registrationFormPage = RegistrationFormPage(page) | ||
|
||
registrationFormPage.enterCurrentAddress(currentAddress) | ||
|
||
assertEquals(currentAddress, registrationFormPage.getCurrentAddressValue()) | ||
} | ||
} |