Skip to content

Instantly share code, notes, and snippets.

@freynaud
Created May 21, 2012 08:29
Show Gist options
  • Save freynaud/2761168 to your computer and use it in GitHub Desktop.
Save freynaud/2761168 to your computer and use it in GitHub Desktop.
package com.ebay.ieapp;
import static com.ebay.support.IOSListener.getSession;
import java.io.File;
import org.testng.Reporter;
import org.testng.annotations.Listeners;
import org.testng.annotations.Test;
import com.ebay.ieapp.screens.HomeScreen;
import com.ebay.ieapp.screens.SellScreen;
import com.ebay.ieapp.screens.SignInScreen;
import com.ebay.ieapp.screens.UserAgreementScreen;
import com.ebay.support.IOSListener;
import com.ebay.support.IOSTest;
import com.ebay.support.SuiteListener;
@Listeners({IOSListener.class, SuiteListener.class})
public class SignInDemo {
@Test
@IOSTest(language = "en", locale = "en_GB", hack = true, ide = false)
public void signInEN() throws Exception {
signIn();
}
@Test
@IOSTest(language = "fr", locale = "fr", hack = true, ide = false)
public void signInFR() throws Exception {
signIn();
}
@Test
@IOSTest(language = "it", locale = "it_IT", hack = true, ide = false)
public void signInIT() throws Exception {
signIn();
}
@Test
@IOSTest(language = "es", locale = "es_US", hack = true, ide = false)
public void signInES() throws Exception {
signIn();
}
@Test
@IOSTest(language = "de", locale = "de_DE", hack = true, ide = false)
public void signInDE() throws Exception {
signIn();
}
private void signIn() throws Exception {
try {
UserAgreementScreen ua = new UserAgreementScreen();
ua.accept();
HomeScreen home = new HomeScreen();
home.sell();
SignInScreen signIn = new SignInScreen();
signIn.signIn("ABC", "pass");
SellScreen screen = new SellScreen();
} finally {
File f = new File(getSession().getLanguage()+".png");
System.out.println(f.getAbsolutePath());
getSession().takeScreenshot(f);
Reporter.log("<img src='"+f.getAbsolutePath()+"' />");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment