WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/test/java/com/yourcompany/Tests/TestBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;
import org.testng.ITestResult;
import org.testng.annotations.BeforeSuite;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Listeners;
import org.testng.Assert;

import java.lang.reflect.Method;
import java.net.MalformedURLException;
Expand Down Expand Up @@ -42,6 +44,13 @@ public class TestBase {
*/
private ThreadLocal<String> sessionId = new ThreadLocal<String>();

/** Checks that authentication credentials have been set */
@BeforeSuite
private void checkForCredentials(){
Assert.assertNotNull(username, "The SAUCE_USERNAME environment variable must be set.");
Assert.assertNotNull(accesskey, "The SAUCE_ACCESS_KEY environment variable must be set.");
}

/**
* DataProvider that explicitly sets the browser combinations to be used.
*
Expand Down