Selenium Acceptance/Integration Tests for a Google App Engine application using maven-gae-plugin

 this is just a little tip on how to setup selenium acceptance tests for a Google App Engine java application when using maven-gae-plugin.
  • First, be sure you are using an earlier version (> 0.9.6 release ; eg. the latest snapshot version) of maven-gae-plugin.
    Here is an extract of a pom for the plugin repository and selenium deps right here :


     <!-- acceptance tests -->  

  • Then, map the gae-start and gae-stop executions to the pre/post integration phases. This is an example of the plugin configuration :

  • The next and last step is to write your acceptance test. Here is just a simple example :
 package net.mademocratie.gae.acceptancetest;  
 import org.junit.After;  
 import org.junit.Before;  
 import org.junit.Test;  
 import org.openqa.selenium.WebDriver;  
 import org.openqa.selenium.firefox.FirefoxDriver;  
 import static com.thoughtworks.selenium.SeleneseTestBase.assertEquals;  
 public class HomePageIT {  
   private WebDriver driver;  
   public void setUp() {  
     driver = new FirefoxDriver();  
   public void home_page_should_be_displayed() {  
     assertEquals("Ma Democratie", this.driver.getTitle());  
   public void tearDown() {  

You should find a full running sample on the github repository of ma-dem-ae.
NB: (possible) related issue #5
PS: thanks to codeformatter for this post ;)
PS(bis): oO i just heard that CasperJS or cucumber.js could do the job too...

Aucun commentaire:

Enregistrer un commentaire

Mots clés du blog

10.1 4G acceptancetest adb androï Android androïd Android7 api appender appengine application applications archive array assistantematernelle astuce auth0 authentication authority automation Axis bash bearer blog boot bootloader bower build bundle c calendrier camille combal cdi certificate cf client cloudfoundry collaboratif command commandes connexion console css cyanogen decrypt démasquées démasquer développement dll dump easter eggs écologie écrit employeur EMUI EMUI5.0 encrypt enfant évènement export-package ExtJS fab fastboot fiche find firefox gadget galaxytab gelf gem git gmail gnupg gooelappengine google gparted gpg gpg2 gps graylog grenoble Grid gui harddrive heroku hover howto HTML http https IE ihm immobilier imprimante innovation insolite instance integration Java JavaScript jenkins jeu jobs json json-schema-validator key keystore labs linux livre log log4j logger logs lombok masquées masquer maven maven-gae-plugin Mémoire microsoft mobile mockito mondialisation monitor MUSE musique en ligne myopera nodejs npm NT NTEventLogger onglet openstack osgi paas package parameters parent php politique prosyst prototype proxies proxy quartz radio rappel recherche regex repository resize RIA ridge rock ROM route ruby rubygems s8500 samsung scheduler scm secret secure sel selenium Serializer server shared shell sign signature slf4j smartphone so société song spy ssh ssl struct swagger swig tâches téléphone téléréalité test thunderbird timeout token Tomcat tooltip tooltips truststore TWRP ubuntu unit test validator verify virgin virtualbox wave waze web WebApp wiki wikimedia wikipédia wikipen wiko windows yahoo youtube yum