Skip to content

Commit

Permalink
deleted problematic test in react
Browse files Browse the repository at this point in the history
  • Loading branch information
andrecupa committed Nov 8, 2023
1 parent 0ecc432 commit c6c1679
Showing 1 changed file with 0 additions and 163 deletions.
163 changes: 0 additions & 163 deletions Tests/OpenviduTests/src/test/java/openViduReactTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -157,127 +157,6 @@ void T001_JoinSession(){
}
}

/**
* Test with Java -> T002_LeaveSession
*
* @author Andrea Acuña
* Description: verification that the video is playing property and both browsers leaves the session correctly
*/
@Test
void T002_LeaveSession(){

TESTNAME = new Throwable().getStackTrace()[0].getMethodName();
test = e.startTest(TESTNAME, "Join the session and verifies that the two browsers are inside the session", extentReports);

e.addStepWithoutCapture(test, "INFO", "Starting test " + TESTNAME);

// Configurate the session in chrome
WebElement sessionC = driverChrome.findElement(By.id(idNameSession));
sessionC.clear();
sessionC.sendKeys(nameSession);
WebElement participantC = driverChrome.findElement(By.id(idParticipant));
participantC.clear();
participantC.sendKeys("PARTICIPANTCHROME");
WebElement joinButtonC = driverChrome.findElement(By.xpath(XpathJoinButton));
joinButtonC.submit();

//Configurate de session in firefox
WebElement textBoxF = driverFirefox.findElement(By.id(idNameSession));
textBoxF.clear();
textBoxF.sendKeys(nameSession);
WebElement participantF = driverFirefox.findElement(By.id(idParticipant));
participantF.clear();
participantF.sendKeys("PARTICIPANTFIREFOX");
WebElement joinButtonF = driverFirefox.findElement(By.xpath(XpathJoinButton));
joinButtonF.submit();

try{
// see if the video is playing properly, moreover synchronize both videos
WebDriverWait waitC = new WebDriverWait(driverChrome, Duration.ofSeconds(30));
waitC.until(ExpectedConditions.visibilityOfElementLocated(By.id(idSelfCamera)));
waitC.until(ExpectedConditions.visibilityOfElementLocated(By.xpath(xpathOtherCamera)));

WebDriverWait waitF = new WebDriverWait(driverFirefox, Duration.ofSeconds(30));
waitF.until(ExpectedConditions.visibilityOfElementLocated(By.id(idSelfCamera)));
waitF.until(ExpectedConditions.visibilityOfElementLocated(By.xpath(xpathOtherCamera)));

String SelfCurrentTimeChrome = driverChrome.findElement(By.id(idSelfCamera)).getAttribute("currentTime");
String SelfCurrentTimeFirefox = driverFirefox.findElement(By.id(idSelfCamera)).getAttribute("currentTime");

String OtherCurrentTimeChrome = driverChrome.findElement(By.xpath(xpathOtherCamera)).getAttribute("currentTime");
String OtherCurrentTimeFirefox = driverFirefox.findElement(By.xpath(xpathOtherCamera)).getAttribute("currentTime");

if (Float.parseFloat(SelfCurrentTimeChrome) > 0 && Float.parseFloat(SelfCurrentTimeFirefox) > 0){
if (Float.parseFloat(OtherCurrentTimeChrome) > 0 && Float.parseFloat(OtherCurrentTimeFirefox) > 0){
e.addStep(test, "INFO", driverChrome, "Videos playing ok in Chrome: Self video is: " + SelfCurrentTimeChrome + " Seconds and Other video is: " + OtherCurrentTimeChrome + " Seconds");
e.addStep(test, "INFO", driverFirefox, "Videos playing ok in Firefox: Self video is: " + SelfCurrentTimeFirefox + " Seconds and Other video is: " + OtherCurrentTimeFirefox + " Seconds");

WebElement leaveButtonC = driverChrome.findElement(By.id(idLeaveButton));
if (leaveButtonC.isDisplayed()){
leaveButtonC.click();
e.addStep(test, "INFO", driverChrome, "Leave button was click in Chrome");
}else{
e.addStep(test, "FAIL", driverChrome, "Leave button in chrome is not display");
fail("The app is not correctly leave");
}

WebElement titleC = driverChrome.findElement(By.id(idMainTitle));
if(titleC.isDisplayed()){
e.addStep(test, "INFO", driverChrome, "Session correctly leave in Chrome");
}else{
e.addStep(test, "FAIL", driverChrome, "Session is not leave in Chrome");
fail("Session is not leave in Chrome");
}

//Leave the session with Firefox

WebElement leaveButtonF = driverFirefox.findElement(By.id(idLeaveButton));
if (leaveButtonF.isDisplayed()){
leaveButtonF.click();
e.addStep(test, "INFO", driverFirefox, "Leave button was click i Firefox");
}else{
e.addStep(test, "FAIL", driverFirefox, "Leave button in Firefox is not display");
fail("The app is not correctly leave");
}

WebElement titleF = driverFirefox.findElement(By.id(idMainTitle));
if(titleF.isDisplayed()){
e.addStep(test, "INFO", driverFirefox, "Session correctly leave in Firefox");
}else{
e.addStep(test, "FAIL", driverFirefox, "Session is not leave in Firefox");
fail("Session is not leave in Chrome");
}
}else{
if (Float.parseFloat(OtherCurrentTimeChrome) > 0){
e.addStep(test, "FAIL", driverFirefox, "Other Video is not playing in Firefox");
}else{
e.addStep(test, "FAIL", driverChrome, "Other Video is not playing in Chrome");
}
fail("Self Video is not playing in app");
}
} else {
if (Float.parseFloat(SelfCurrentTimeChrome) > 0){
e.addStep(test, "FAIL", driverFirefox, "Self Video is not playing in Firefox");
}else{
e.addStep(test, "FAIL", driverChrome, "Self Video is not playing in Chrome");
}
fail("Self Video is not playing in app");
}
}catch (TimeoutException n){

e.addStep(test, "FAIL", driverChrome, "Error in chrome: " + n.getMessage());
e.addStep(test, "FAIL", driverFirefox, "Error in firefox: " + n.getMessage());
fail("The app is not correctly inicializate. There are a TimeoutException: " + n.getMessage());

}catch (Exception ex) {

e.addStep(test, "FAIL", driverChrome, "Error in chrome: " + ex.getMessage());
e.addStep(test, "FAIL", driverFirefox, "Error in firefox: " + ex.getMessage());
fail("An unexpected exception occurred: " + ex.getMessage());
}

}

/**
* Test with Java -> T003_SessionHeader
*
Expand Down Expand Up @@ -331,48 +210,6 @@ void T003_SessionHeader(){
}
}

/**
* Test with Java -> T004_ParticipantName
*
* @author Andrea Acuña
* Description: Joins the session and verifies that the chrome participant name is correct
*/
@Test
void T004_ParticipantName(){
TESTNAME = new Throwable().getStackTrace()[0].getMethodName();
test = e.startTest(TESTNAME, "Join the session and verifies that the two browsers are inside the session", extentReports);

e.addStepWithoutCapture(test, "INFO", "Starting test " + TESTNAME);

// Configurate the session in chrome
WebElement nameTextBox = driverChrome.findElement(By.id(idNameParticipant));
nameTextBox.clear();
nameTextBox.sendKeys(NAMEPARTICIPANT);
WebElement joinButtonC = driverChrome.findElement(By.xpath(XpathJoinButton));
joinButtonC.submit();

try{
WebDriverWait waitC = new WebDriverWait(driverChrome, Duration.ofSeconds(30));
waitC.until(ExpectedConditions.visibilityOfElementLocated(By.xpath(xpathParticipant)));

if (NAMEPARTICIPANT.equals(driverChrome.findElement(By.xpath(xpathParticipant)).getText())){
e.addStep(test, "PASS", driverChrome, "TEST: " + TESTNAME +" ok: Participant name is: " + NAMEPARTICIPANT);
}else{
e.addStep(test, "FAIL", driverChrome, "Participant name is: " + driverChrome.findElement(By.xpath(xpathParticipant)).getText() + " but should be: " + NAMEPARTICIPANT);
}

}catch (TimeoutException n){

e.addStep(test, "FAIL", driverChrome, "Error in chrome: " + n.getMessage());
fail("The app is not correctly inicializate. There are a TimeoutException: " + n.getMessage());

}catch (Exception ex) {

e.addStep(test, "FAIL", driverChrome, "Error in chrome: " + ex.getMessage());
fail("An unexpected exception occurred: " + ex.getMessage());
}
}

/**
* AfterEach.
*
Expand Down

0 comments on commit c6c1679

Please sign in to comment.