-
-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added example code for digest authentication and removed commented li…
…nes from all testng.xml files (#137)
- Loading branch information
1 parent
d5dc0b0
commit ea27333
Showing
14 changed files
with
83 additions
and
52 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
src/test/java/io/github/mfaisalkhatri/tests/theinternet/DigestAuthTest.java
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,28 @@ | ||
package io.github.mfaisalkhatri.tests.theinternet; | ||
|
||
import io.github.mfaisalkhatri.pages.theinternet.MainPage; | ||
import io.github.mfaisalkhatri.tests.base.BaseSuiteSetup; | ||
import org.openqa.selenium.By; | ||
import org.testng.annotations.BeforeClass; | ||
import org.testng.annotations.Test; | ||
|
||
import static io.github.mfaisalkhatri.drivers.DriverManager.getDriver; | ||
import static org.testng.Assert.assertEquals; | ||
|
||
public class DigestAuthTest extends BaseSuiteSetup { | ||
|
||
@BeforeClass | ||
public void testSetup() { | ||
final String websiteLink = "http://the-internet.herokuapp.com/"; | ||
getDriver().get(websiteLink); | ||
final MainPage mainPage = new MainPage(); | ||
mainPage.clickLink("Basic Auth"); | ||
} | ||
|
||
@Test | ||
public void testAuthentication() { | ||
getDriver().get("https://admin:admin@the-internet.herokuapp.com/basic_auth"); | ||
final String successMessageText = getDriver().findElement(By.cssSelector(".example p")).getText(); | ||
assertEquals(successMessageText, "Congratulations! You must have the proper credentials."); | ||
} | ||
} |
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 |
---|---|---|
|
@@ -10,5 +10,5 @@ | |
</methods> | ||
</class> | ||
</classes> | ||
</test> <!-- Test --> | ||
</suite> <!-- Suite --> | ||
</test> | ||
</suite> |
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
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
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
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
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
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
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
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
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
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
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
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