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
@AfterMethod(alwaysRun = true) | |
public void shutDownDriver(ITestResult result) throws IOException { | |
// Update SauceLabs result | |
if(testbed.equals("saucelab")) { | |
String jobID = ((RemoteWebDriver)driver).getSessionId().toString(); | |
SauceREST client = new SauceREST("username", "key"); | |
Map<String, Object>sauceJob = new HashMap<String, Object>(); | |
sauceJob.put("name", "Test method: "+result.getMethod().getMethodName()); | |
if(result.isSuccess()) { |
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
import javax.mail.Authenticator; | |
import javax.mail.Flags; | |
import javax.mail.Folder; | |
import javax.mail.Message; | |
import javax.mail.MessagingException; | |
import javax.mail.PasswordAuthentication; | |
import javax.mail.Session; | |
import javax.mail.Store; | |
import javax.mail.internet.InternetAddress; | |
import javax.mail.search.FromTerm; |
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
using System; | |
using System.Text; | |
using System.Text.RegularExpressions; | |
using System.Threading; | |
using NUnit.Framework; |
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
package com.yahoo.test.library; | |
import org.testng.Assert; | |
import org.testng.Reporter; | |
import com.thoughtworks.selenium.SeleneseTestBase; | |
public class CustomVerification extends SeleneseTestBase { | |
private StringBuffer verificationErrors; |
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
@Test(groups="non-grid", alwaysRun=true) | |
public void verifyTaggedBlogs() throws InterruptedException { | |
customVerification.verifyTrue(actualblogTag.equalsIgnoreCase(expectedBlogtag.trim()), "Expected Blogs with tag: " +expectedBlogtag+ | |
", While actual tag is: " +actualblogTag); | |
customVerification.verifyTrue(selenium.isElementPresent(getPageElement("BlogsHomePage", "NTad")), | |
customVerification.verifyTrue(selenium.isElementPresent(getPageElement("BlogsHomePag | |
customVerification.checkForVerificationErrors(); | |
} |
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
/** | |
* Provides object ids or name for HTML object input | |
* | |
* @param inputType Could be checkbox, TextBox or Radio button | |
* @return objectId | |
* | |
*/ | |
public static String[] getInputObjects(String inputType) { | |
StringBuilder sb = new StringBuilder("var objectId = [];") |
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
public class LoginTest { | |
@Test | |
public void testLogin() { | |
login(userName, userPassword); | |
waitForCondition("selenium.isElementPresent(\""+UserDashboard.getDashboardLocator()+"\")", "60000"); | |
// Some assertion here | |
} | |
} | |
class UserDashboard { |
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
package core; | |
import org.openqa.selenium.server.SeleniumServer; | |
import org.testng.annotations.AfterClass; | |
import org.testng.annotations.AfterSuite; | |
import org.testng.annotations.BeforeClass; | |
import org.testng.annotations.BeforeSuite; | |
import org.testng.annotations.Parameters; | |
import com.thoughtworks.selenium.DefaultSelenium; | |
import com.thoughtworks.selenium.Selenium; |
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
package core; | |
import java.util.concurrent.TimeUnit; | |
import org.openqa.selenium.WebDriver; | |
import org.openqa.selenium.firefox.FirefoxDriver; | |
import org.testng.ITestResult; | |
import org.testng.annotations.AfterMethod; | |
import org.testng.annotations.BeforeMethod; | |
import org.testng.annotations.Parameters; |
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
scenario "Searching restaurant in your Bangalore", { | |
given "the user is on the Google home page", { | |
end_user.is_the_google_home_page() | |
} | |
when "the end user types restaurant in search box", { | |
end_user.searches_for "restaurant" | |
} | |
then "they should location listing for 'BBQ Nation", { | |
end_user.should_see_search_result_page_with_word "BBQ Nation" | |
} |
OlderNewer