Selenium

 

Ecco un articolo sull’integrazione con Selenium Test nel Developer Cloud Service, che include un’applicazione di esempio. Trovate l’originale qui.

Enjoy 🙂

This blog entry illustrates how to configure DevCS to run a simple Selenium Test against a very basic web page. Thanks to Nobuhiko Sekiya – Oracle Senior Sales Consultant for his valuable input.

The selenium test java class (EasywebappTest.java) inside the eclipse (OEPE 12.2.1.1) project, easywebapp, will just verify the string shown in the web page (top.jsp). To begin, download the simple eclipse project with selenium test, easywebapp.zip, from the attachment below. Import this project into your eclipse IDE and connect to your DevCS cloud instance. Note: This application was created and tested in DevCS 15.4.5 with deployment to JCS and not JCS-SX. Now you want to push this source to your DevCS project. If you haven’t created a project in DevCS, then do so now. A good tutorial to follow that illustrates creating a project in DevCS, importing an “Existing Project into a Workspace” in OEPE and synchronizing the workspace with DevCS is available on the DevCS Product Page here.

Note: JCS-SX by default has authentication enabled and a login dialog will popup at access. This is not the case with JCS. Therefore in this example, the Selenium test will fail on JCS-SX.

Now for the core of configuring DevCS to run a Selenium Test. This resides in Hudson Build Configurations and Deployment Configurations. Note: You will have to have a successful build of your app before you can set up an automatic deployment profile in that you will have to have a deployable artifact to complete the deployment configuration. Once you’ve successfully built your easywebapp, you create your deployment configuration and then further configure your Hudson easywebapp_build job. You will also create a second build job named easywebapp_selenium and it is set to run whenever easywebapp_build is built. So as you see, there are a few dependencies here and you will have to go back into your build jobs to further configure them as you go through this process.

So here we go and hopefully it all makes sense when we’re finished. Note: If not shown in these images settings are at the default.

Hudson Build Job easywebapp_build
Step 1: Create a new Hudson build job – easywebapp_build
Sel1.png

Step 2: Configure build job Source Control settings
Sel2.png

Step 3: Configure build job Triggers
Sel3.png

Step 4: Configure build job Build Steps
Sel4.png

Step 5: Configure build job Post Build activities. Note: This shows adding the Deploy Task. You won’t be able to add this until after you’ve had a successful build and then created the Deployment Configuration.

Sel5.png

Step 6: Save your configuration and run your build. If successful, you will have a build artifact to work with in creating a deployment profile. Also notice the Add Deploy Task at the bottom of the previous image. You will modify this Hudson build job once you’ve created your deployment profile and add the following information:
Deployment Configuration: easywebapp
Job: easywebapp_build
Artifact: target/easywebapp.war

Step 7: Your Deployment Configuration will be configured as follows and Note: you will have to do this before modifying your Hudson build job easywebapp_build as I outlined at the beginning of Step 6 above. After successfully creating this Deployment configuration, you will modify the Hudson Build Job easywebapp-build as illustrated in Step 6 above.
Configuration Name: easywebapp
Application Name: easywebapp
Java Service: Select your JCS Service that your previously configured. See further reading at the end of this blog entry for details.
Type: On Demand
Job: easywebapp_build
Build: Pick the most recent stable build (Note: the Selenium test will run against the most recent deployment)
Artifact: easywebapp/target/easywebapp.war

Sel7.png

Hudson Build Job easywebapp_selenium
Step 1: Create a new Hudson build job – easywebapp_selenium

Hud1.png
Step 2: Configure build job Source Control settings

Hud2.png

Step 3: Configure build job Triggers and select the build job easywebapp_build

Hud3.png

Step 4: Configure build job Environment Xvfb Screen and Display Name Offset

Hud4.png
Step 5: Configure build job Build Steps. Note: that the environment variables HTTPS_PROXY_HOST and HTTPS_PROXY_PORT are available to Hudson. The baseurl in Properties should be set to your JCS access url (to the JCS load balancer or directly to the managed server). See further reading at the end of this blog entry for details.

Hud5.png
Step 6: Configure build job Post Build activities to see the test results after the build is finished.

Hud6.png

Step 7: Run the Hudson build job easywebapp_build which will build the app, deploy the artifact (.war) to JCS and run the selenium test against JCS. You can validate success via the log files as configured in Step 6 above.

Further information – Configuring DevCS to deploy to JCS
Check out Edi Vaserman’s blog entry on “How to deploy from your Developer Cloud Service to JCS” to learn how to configure your deployment with public and private keys for your environment.

 

Advertisements

Docker, WebLogic e Kitematic

La civiltà occidentale ci rende naturalmente pigri, e quindi siamo affascinati da GUI che sembrano sempre più facili da usare. Lo strumento di amministrazione di Docker sul Mac (e, per quel che ne so, anche su Windows) è – per ora – Kitematic, in beta, che sembra funzionale e sufficientemente completo per scaricare e lanciare immagini Docker dai repositories presenti su hub.docker.com.

Per provare questa visual novelty e mettere da parte l’animo hacker chiudendo il terminale a caratteri, è necessario:

  • Teletrasportarsi su beta.docker.com e prenotare un token (se siete su Mac/Windows)
  • Aspettare pazientemente la mail con il token e il link per il download
  • Invocare Cthulhu (sempre) leggendo “L’ombra venuta dal tempo” di H.P. Lovecraft
  • Installare Docker + Kitematic per Mac/ Windows
  • Chiamare il Malefico Marini e far sorgere in lui un minimo di aspettativa
  • Avviare Kitematic e scegliere un’istanza da provare (casualmente, WebLogic 12.2.1)
  • Assicurarsi di avere banda passante adeguata
  • Allocare 5 minuti del proprio tempo prezioso (non ci vuole di più)
  • Voilà.

Oppure dare un occhiata alle istruzioni in movimento qui sotto. Oppure rimanere con la buona, vecchia, immarcescibile command line a fosfori verdi con cui conviviamo da svariati decenni, pensando che se non si è estinta fino ad ora la vedremo anche nel prossimo…

Enjoy 🙂

Meetup DevOps: 31 Maggio 2016

Ciao DevOppers 🙂

Benvenuti al nostro primo Meetup, una sessione pratica sulle tecnologie DevOps di Oracle che includono le componenti Cloud, e parte di un ciclo che prevederà workshops e aggiornamenti.  Ecco l’agenda:

Developer Cloud Service – hands on

– Sviluppo e continuous integration di applicazioni su JEE (Java Cloud Service) – hands on

– Sviluppo e continuous integration di applicazioni su containers (Application Container Cloud Service) – hands on

Vi aspettiamo fiduciosi e trepidanti nella sede Oracle di Via Bombay 1, a Roma (Torrino), zero slides e molta interazione! Potete iscrivervi qui: http://www.meetup.com/Roma-Oracle-DevOps-Channel/events/230984981/

Enjoy 🙂