Skip to content

Commit

Permalink
Merge pull request #144 from cmicoege/minorChanges
Browse files Browse the repository at this point in the history
Cleaning code of some MrChecker tests and a readme errata regarding MrChecker
  • Loading branch information
sjimenez77 authored Nov 23, 2018
2 parents 1752cec + 95ec577 commit e68c325
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 15 deletions.
2 changes: 1 addition & 1 deletion README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Tool used for Continuous Integration and Continuous Delivery. Inside of this Jen

* **Mr Checker**

MrChecker is a testing framework included in devonfw with several useful modules, from which we will focus on the Selenium Module, a module designed to make end-to-end testing easier to implement. More about it [here](https://github.com/devonfw/devonfw-testing/wiki).
MrChecker is a testing framework included in devonfw with several useful modules, from which we will focus on the Selenium Module, a module designed to make end-to-end testing easier to implement. More about it link:https://github.com/devonfw/devonfw-testing/wiki[here].

=== Deprecated

Expand Down
22 changes: 20 additions & 2 deletions mrchecker/endtoend-test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@

<!-- Allure test framework modules -->
<mrchecker-core-module.version>4.12.0.10</mrchecker-core-module.version>
<mrchecker-selenium-module.version>3.8.1.12</mrchecker-selenium-module.version>
<mrchecker-selenium-module.version>3.8.1.13</mrchecker-selenium-module.version>
<mrchecker-security-module.version>1.1.3</mrchecker-security-module.version>
<mrchecker-webapi-module.version>1.1.5</mrchecker-webapi-module.version>

Expand Down Expand Up @@ -139,12 +139,30 @@
<version>${mrchecker-core-module.version}</version>
</dependency>





<!-- Selenium module -->

<dependency>

<groupId>com.capgemini.mrchecker</groupId>

<artifactId>mrchecker-selenium-module</artifactId>

<version>${mrchecker-selenium-module.version}</version>

</dependency>


<!-- Selenium module
<dependency>
<groupId>com.capgemini.mrchecker</groupId>
<artifactId>mrchecker-selenium-module</artifactId>
<version>${mrchecker-selenium-module.version}</version>
</dependency>
</dependency>-->


<!-- Security module -->
<dependency>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
package com.devonfw.mts.common.readProperties;

/**
* @author Juan Andrés Ambuludi Olmedo
* @author Jorge Dacal Cantos
* @author Carlos Micó Egea
*/
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,10 @@ public static void sendKeysWithCheck(String text, By textFieldSearchCriteria, IN
} catch (TimeoutException e) {

System.out.println("Character not written: " + character);
System.out.println("Waiting for it to be written...");
}
}
System.out.println("Progress: " + text.substring(0, i + 1));
// System.out.println("Progress: " + text.substring(0, i + 1));
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,8 @@ public void setUpDateAndTime() {

WebElement arrowButton = getDriver().findElementDynamic(arrowSearch);
WebElement ticButton = getDriver().findElementDynamic(ticSearch);
System.out.println("cosas hechas");
arrowButton.click();
ticButton.click();
System.out.println("clicks hechos");
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,11 @@
import com.devonfw.mts.common.readProperties.ConfigFileReader;

/**
* @author jambulud
* @author Juan Andrés Ambuludi Olmedo
* @author Jorge Dacal Cantos
* @author Carlos Micó Egea
*/

// @Configuration // no se si esto hace falta o no, lo he copiado de otra version (Carlos)
// @PropertySource("file:config.properties")
public class ThaiHomePage extends BasePage {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,11 @@
import com.devonfw.mts.common.utils.Utils;

/**
* @author jambulud
* @author Juan Andrés Ambuludi Olmedo
* @author Jorge Dacal Cantos
* @author Carlos Micó Egea
*/

public class ThaiReservationsPage extends BasePage {

/* Search criteria */
Expand Down Expand Up @@ -161,7 +164,6 @@ private HashMap<String, List<Reservation>> getReservationsShownByDate(
reservations = getDriver().findElementDynamics(reservationsTableSearch);

for (int i = 1; i <= reservations.size(); i++) {
System.out.println(reservations.size());

date = getDriver().findElementDynamic(findDataCell(i, 1)).getText();
email = getDriver().findElementDynamic(findDataCell(i, 2)).getText();
Expand All @@ -173,7 +175,7 @@ private HashMap<String, List<Reservation>> getReservationsShownByDate(
e.printStackTrace();
}

System.out.printf("date: %s, email: %s, id: %s\n", date, email, id);
// System.out.printf("date: %s, email: %s, id: %s\n", date, email, id);

reservationsByDate = idReservations.getOrDefault(date, new LinkedList<Reservation>());
reservationsByDate.add(new Reservation(date, email, id));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@
import com.devonfw.mts.common.data.Reservation;

/**
* @author jambulud
*
* @author Juan Andrés Ambuludi Olmedo
* @author Jorge Dacal Cantos
* @author Carlos Micó Egea
*/

public class ThaiTableBodyPage extends BasePage {

/* Search criteria */
Expand Down Expand Up @@ -70,7 +72,7 @@ public Map<String, List<Reservation>> getReservations(Map<String, List<Reservati
email = reservationsRow.get(1);
id = reservationsRow.get(2);

System.out.printf("date: %s, email: %s, id: %s\n", date, email, id);
// System.out.printf("date: %s, email: %s, id: %s\n", date, email, id);

reservationsByDate = idReservations.getOrDefault(date, new LinkedList<Reservation>());
reservationsByDate.add(new Reservation(date, email, id));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ private void bookTable(Reservation reservation) {

ThaiBookPage myBookPage = this.myThaiStarHome.clickBookTable();

System.out.println("Reserva in bookTable: " + reservation.getDate());
ThaiConfirmBookPage myComfirmPage = myBookPage.enterBookingData(reservation);
myComfirmPage.confirmBookingData();
myBookPage.checkConfirmationDialog();
Expand All @@ -125,7 +124,6 @@ private void verifyBooking(Reservation reservation) {
ThaiWaiterPage myWaiterPage = new ThaiWaiterPage();
ThaiReservationsPage myReservationsPage = myWaiterPage.switchToReservations();
HashMap<String, List<Reservation>> reservations = myReservationsPage.searchDatesByEmail(reservation.getEmail());
System.out.println("Reserva in verifyBooking: " + reservation.getDate());
Assert.assertTrue("Booking not found", reservations.containsKey(reservation.getDate()));
List<Reservation> reservationsForDate = reservations.get(reservation.getDate());
Assert.assertFalse("Booking not found", reservationsForDate.isEmpty());
Expand Down

0 comments on commit e68c325

Please sign in to comment.