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
class Sort extends Comp<Person> {{r = t1.getName().compareTo(t2.getName());}} | |
List<Person> sortedPersons = from(with(Sort.class)).sortedCopy(asList(john, joe)); |
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
<!--Ajouter la property--> | |
<sonar.jacoco.itReportPath>${project.build.directory}/jacoco-it.exec</sonar.jacoco.itReportPath> | |
<!-- Ajout du plugin jacoco et configuration de l'agent --> | |
<plugin> | |
<groupId>org.jacoco</groupId> | |
<artifactId>jacoco-maven-plugin</artifactId> | |
<version>0.6.2.201302030002</version> | |
<configuration> | |
<propertyName>jacoco.agent.argLine</propertyName> |
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 | |
public void casUsageFonctionnel(WebDriver driver) { | |
String baseUrl = "http://localhost:8080"; | |
driver.get(baseUrl + "/books/"); | |
driver.findElement(By.id("form:selectAccounts")).click(); | |
assertEquals("Identification", driver.getTitle()); | |
driver.findElement(By.id("j_username")).clear(); | |
driver.findElement(By.id("j_username")).sendKeys("admin"); | |
driver.findElement(By.id("login")).click(); | |
assertEquals("Application books", driver.getTitle()); |
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
user | |
open /books/ | |
clickAndWait id=form:selectAccounts | |
assertTitle Identification | |
type id=j_username admin | |
clickAndWait id=login | |
assertTitle Application books | |
clickAndWait id=form:selectAccounts | |
assertTitle Recherche de Compte Utilisateur | |
click //div[@id='form:username_panel']/ul/li |
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 | |
public void accountTest() { | |
logInAsAdmin(); | |
selectAccounts(); | |
selectHomer(); | |
updateUsernamePasswordAndEmail(); | |
updateAdress(); | |
addAdminRole(); | |
addGodRole(); | |
addDocument(); |
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 LoginPage { | |
@FindBy(id = "j_username") | |
public WebElement user; | |
@FindBy(id = "j_password") | |
public WebElement password; | |
@FindBy(id = "login") | |
public WebElement loginButton; | |
public void login(String userValue, String passwordValue) { | |
user.clear(); |
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 ScenarioIT extends SeleniumTest { | |
// account | |
AccountSearch accountSearch; | |
AccountEdit accountEdit; | |
// document | |
DocumentSearch documentSearch; | |
DocumentEdit documentEdit; | |
// role |
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
webClient.hasMessage("Saved " + userName + " successfully in database"); |
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 void waitUntilRemoved(final By by) { | |
try { | |
until(new ExpectedCondition<Boolean>() { | |
@Override | |
public Boolean apply(WebDriver from) { | |
from.manage().timeouts().implicitlyWait(0, TimeUnit.SECONDS); | |
try { | |
return from.findElements(by).isEmpty(); | |
} catch (NoSuchElementException e) { | |
return true; |
OlderNewer