This document discusses why every tester should learn Ruby. It notes that testers often use scripting languages like VBScript, SQABasic, RobotJ, and VU to automate tests, but that Ruby is a better alternative being a simple yet powerful object-oriented and dynamic programming language. Ruby has a high testing culture in its community and is used for test automation with frameworks like Selenium and Watir for web testing, JRuby for GUI testing with Java libraries, and can interface with databases using Ruby-PLSQL-Spec for testing Oracle PL/SQL code. The document provides examples of test scripts in Ruby and argues that Ruby allows tests to serve as executable specifications.
Video presentation: https://www.youtube.com/watch?v=jLAFXQ1Av50
Most applications written in Ruby are great, but also exists evil code applying WOP techniques. There are many workarounds in several programming languages, but in Ruby, when it happens, the proportion is bigger. It's very easy to write Ruby code with collateral damage.
You will see a collection of bad Ruby codes, with a description of how these codes affected negatively their applications and the solutions to fix and avoid them. Long classes, coupling, misapplication of OO, illegible code, tangled flows, naming issues and other things you can ever imagine are examples what you'll get.
Http4s, Doobie and Circe: The Functional Web StackGaryCoady
Http4s, Doobie and Circe together form a nice platform for building web services. This presentations provides an introduction to using them to build your own service.
The fundamentals and advance application of Node will be covered. We will explore the design choices that make Node.js unique, how this changes the way applications are built and how systems of applications work most effectively in this model. You will learn how to create modular code that’s robust, expressive and clear. Understand when to use callbacks, event emitters and streams.
Love it or hate it, JavaScript is playing an increasingly important role in the next generation of web and mobile apps. As code continues to move from the server to the client, JavaScript is being used to do more than simple HTML manipulation. Be prepared for this transition and make sure the JavaScript you write is optimized and ready to perform on desktops and devices! In this session, you will learn ten practical tips that you can use today to write faster, more maintainable, memory friendly JavaScript.
Callbacks, Promises, and Coroutines (oh my!): Asynchronous Programming Patter...Domenic Denicola
This talk takes a deep dive into asynchronous programming patterns and practices, with an emphasis on the promise pattern.
We go through the basics of the event loop, highlighting the drawbacks of asynchronous programming in a naive callback style. Fortunately, we can use the magic of promises to escape from callback hell with a powerful and unified interface for async APIs. Finally, we take a quick look at the possibilities for using coroutines both in current and future (ECMAScript Harmony) JavaScript.
Mobile Open Day: React Native: Crossplatform fast diveepamspb
Заказчиков всегда привлекают кроссплатформенные решения, потому что они разрабатываются в 2 раза быстрее. Но их же всегда волнует вопрос UX: сможет ли кроссплатформа предоставить такую же отзывчивость и красоту, как нативное решение? React Native говорит - да. Мы покажем, как за полчаса начать писать на React Native под две мобильные платформы сразу, обеспечивая при этом нативность внешнего вида и отзывчивость приложения.
Ten useful JavaScript tips & best practicesAnkit Rastogi
In this presentation there are ten useful JavaScript techniques which can be included in your application easily with less friction along with some AngularJs tips and best practices as a bonus. These tips and best practices are accompanied by examples & will cover script loading, design pattern, performance optimization and other areas.
Since best practices are very subjective topics, proper benchmarking needs to be done.
Mathilde Lemée & Romain Maton
La théorie, c’est bien, la pratique … aussi !
Venez nous rejoindre pour découvrir les profondeurs de Node.js !
Nous nous servirons d’un exemple pratique pour vous permettre d’avoir une premiere experience complete autour de Node.js et de vous permettre de vous forger un avis sur ce serveur Javascript qui fait parler de lui !
http://soft-shake.ch/2011/conference/sessions/incubator/2011/09/01/hands-on-nodejs.html
Jan Stępień - GraalVM: Fast, Polyglot, Native - Codemotion Berlin 2018Codemotion
GraalVM challenges the status quo on the JVM. This newly-released JIT compiler brings substantial speed improvements and support for polyglot applications. It also allows us to translate our JVM bytecode into self-contained native binaries. In this session we’ll explore GraalVM’s potential. We’ll focus on Clojure, but our discussion will apply to many more programming languages. We’ll use GraalVM to build small native binaries. We’ll discuss the method’s limitations and their impact. Finally, we’ll build complete Clojure web apps weighing a fraction of their traditional JVM incarnations.
Video presentation: https://www.youtube.com/watch?v=jLAFXQ1Av50
Most applications written in Ruby are great, but also exists evil code applying WOP techniques. There are many workarounds in several programming languages, but in Ruby, when it happens, the proportion is bigger. It's very easy to write Ruby code with collateral damage.
You will see a collection of bad Ruby codes, with a description of how these codes affected negatively their applications and the solutions to fix and avoid them. Long classes, coupling, misapplication of OO, illegible code, tangled flows, naming issues and other things you can ever imagine are examples what you'll get.
Http4s, Doobie and Circe: The Functional Web StackGaryCoady
Http4s, Doobie and Circe together form a nice platform for building web services. This presentations provides an introduction to using them to build your own service.
The fundamentals and advance application of Node will be covered. We will explore the design choices that make Node.js unique, how this changes the way applications are built and how systems of applications work most effectively in this model. You will learn how to create modular code that’s robust, expressive and clear. Understand when to use callbacks, event emitters and streams.
Love it or hate it, JavaScript is playing an increasingly important role in the next generation of web and mobile apps. As code continues to move from the server to the client, JavaScript is being used to do more than simple HTML manipulation. Be prepared for this transition and make sure the JavaScript you write is optimized and ready to perform on desktops and devices! In this session, you will learn ten practical tips that you can use today to write faster, more maintainable, memory friendly JavaScript.
Callbacks, Promises, and Coroutines (oh my!): Asynchronous Programming Patter...Domenic Denicola
This talk takes a deep dive into asynchronous programming patterns and practices, with an emphasis on the promise pattern.
We go through the basics of the event loop, highlighting the drawbacks of asynchronous programming in a naive callback style. Fortunately, we can use the magic of promises to escape from callback hell with a powerful and unified interface for async APIs. Finally, we take a quick look at the possibilities for using coroutines both in current and future (ECMAScript Harmony) JavaScript.
Mobile Open Day: React Native: Crossplatform fast diveepamspb
Заказчиков всегда привлекают кроссплатформенные решения, потому что они разрабатываются в 2 раза быстрее. Но их же всегда волнует вопрос UX: сможет ли кроссплатформа предоставить такую же отзывчивость и красоту, как нативное решение? React Native говорит - да. Мы покажем, как за полчаса начать писать на React Native под две мобильные платформы сразу, обеспечивая при этом нативность внешнего вида и отзывчивость приложения.
Ten useful JavaScript tips & best practicesAnkit Rastogi
In this presentation there are ten useful JavaScript techniques which can be included in your application easily with less friction along with some AngularJs tips and best practices as a bonus. These tips and best practices are accompanied by examples & will cover script loading, design pattern, performance optimization and other areas.
Since best practices are very subjective topics, proper benchmarking needs to be done.
Mathilde Lemée & Romain Maton
La théorie, c’est bien, la pratique … aussi !
Venez nous rejoindre pour découvrir les profondeurs de Node.js !
Nous nous servirons d’un exemple pratique pour vous permettre d’avoir une premiere experience complete autour de Node.js et de vous permettre de vous forger un avis sur ce serveur Javascript qui fait parler de lui !
http://soft-shake.ch/2011/conference/sessions/incubator/2011/09/01/hands-on-nodejs.html
Jan Stępień - GraalVM: Fast, Polyglot, Native - Codemotion Berlin 2018Codemotion
GraalVM challenges the status quo on the JVM. This newly-released JIT compiler brings substantial speed improvements and support for polyglot applications. It also allows us to translate our JVM bytecode into self-contained native binaries. In this session we’ll explore GraalVM’s potential. We’ll focus on Clojure, but our discussion will apply to many more programming languages. We’ll use GraalVM to build small native binaries. We’ll discuss the method’s limitations and their impact. Finally, we’ll build complete Clojure web apps weighing a fraction of their traditional JVM incarnations.
Playing With Fire - An Introduction to Node.jsMike Hagedorn
node.js is an evented server-side Javascript framework powered by the Google V8 Javascript engine. It is a platform ideal for creating highly scalable web applications. It has the same simplicity of frameworks such as Sinatra, but is designed to be more peformant from the ground up. This performance is achieved by making all network I/O non blocking and all file I/O asynchronous. We will go over how that impacts the development experience, and walk through a simple web application. Javascript is foundational to this type of I/O because it is already evented by design. We will also take a brief look a similar evented frameworks such as ruby`s EventMachine.
He will start you at the beginning and cover prerequisites; setting up your development environment first. Afterward, you will use npm to install react-native-cli. The CLI is our go to tool. We use it to create and deploy our app.
Next, you will explore the code. React Native will look familiar to all React developers since it is React. The main difference between React on the browser and a mobile device is the lack of a DOM. We take a look a many of the different UI components that are available.
With React Native you have access to all of the devices hardware features like cameras, GPS, fingerprint reader and more. So we'll show some JavaScript code samples demonstrating it. We will wrap up the evening by deploying our app to both iOS and Android devices and with tips on getting ready for both devices stores.
Taking Jenkins Pipeline to the Extremeyinonavraham
Slide deck from Jenkins User Conference Tel Aviv 2018.
Talking about suggested (best?) practices, tips and tricks, using Jenkins pipeline scripts with shared libraries, managing shared libraries, using docker compose, and more.
Task Runners are a way to automate anything you want from the command line using CFML! You write any sort of logic you want, just like you would with bash scripts, Node, or Python, except you can do it with your favorite language. Task Runners come with dozens of helpful utilities for downloading files, interacting with the user, printing formatted text, and interacting with the file system. Task Runners only require CommandBox to be installed and work great inside Docker as well. We'll cover many of the features available including using modules and lifecycle methods!
Similar to Why Every Tester Should Learn Ruby (20)
Presented at DevClub.lv meeting http://devclub.lv/announcing-6th-devclub-lv
(video recording of talk is here http://devclub.lv/test-driven-development-tdd-why-and-how-raimonds-simanovskis) and at Agile Tour Vilnius 2013 conference (http://www.agileturas.lt/vilnius#raimonds_simanovskis).
Generating a custom Ruby SDK for your web service or Rails API using Smithyg2nightmarescribd
Have you ever wanted a Ruby client API to communicate with your web service? Smithy is a protocol-agnostic language for defining services and SDKs. Smithy Ruby is an implementation of Smithy that generates a Ruby SDK using a Smithy model. In this talk, we will explore Smithy and Smithy Ruby to learn how to generate custom feature-rich SDKs that can communicate with any web service, such as a Rails JSON API.
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...DanBrown980551
Do you want to learn how to model and simulate an electrical network from scratch in under an hour?
Then welcome to this PowSyBl workshop, hosted by Rte, the French Transmission System Operator (TSO)!
During the webinar, you will discover the PowSyBl ecosystem as well as handle and study an electrical network through an interactive Python notebook.
PowSyBl is an open source project hosted by LF Energy, which offers a comprehensive set of features for electrical grid modelling and simulation. Among other advanced features, PowSyBl provides:
- A fully editable and extendable library for grid component modelling;
- Visualization tools to display your network;
- Grid simulation tools, such as power flows, security analyses (with or without remedial actions) and sensitivity analyses;
The framework is mostly written in Java, with a Python binding so that Python developers can access PowSyBl functionalities as well.
What you will learn during the webinar:
- For beginners: discover PowSyBl's functionalities through a quick general presentation and the notebook, without needing any expert coding skills;
- For advanced developers: master the skills to efficiently apply PowSyBl functionalities to your real-world scenarios.
Essentials of Automations: Optimizing FME Workflows with ParametersSafe Software
Are you looking to streamline your workflows and boost your projects’ efficiency? Do you find yourself searching for ways to add flexibility and control over your FME workflows? If so, you’re in the right place.
Join us for an insightful dive into the world of FME parameters, a critical element in optimizing workflow efficiency. This webinar marks the beginning of our three-part “Essentials of Automation” series. This first webinar is designed to equip you with the knowledge and skills to utilize parameters effectively: enhancing the flexibility, maintainability, and user control of your FME projects.
Here’s what you’ll gain:
- Essentials of FME Parameters: Understand the pivotal role of parameters, including Reader/Writer, Transformer, User, and FME Flow categories. Discover how they are the key to unlocking automation and optimization within your workflows.
- Practical Applications in FME Form: Delve into key user parameter types including choice, connections, and file URLs. Allow users to control how a workflow runs, making your workflows more reusable. Learn to import values and deliver the best user experience for your workflows while enhancing accuracy.
- Optimization Strategies in FME Flow: Explore the creation and strategic deployment of parameters in FME Flow, including the use of deployment and geometry parameters, to maximize workflow efficiency.
- Pro Tips for Success: Gain insights on parameterizing connections and leveraging new features like Conditional Visibility for clarity and simplicity.
We’ll wrap up with a glimpse into future webinars, followed by a Q&A session to address your specific questions surrounding this topic.
Don’t miss this opportunity to elevate your FME expertise and drive your projects to new heights of efficiency.
UiPath Test Automation using UiPath Test Suite series, part 3DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 3. In this session, we will cover desktop automation along with UI automation.
Topics covered:
UI automation Introduction,
UI automation Sample
Desktop automation flow
Pradeep Chinnala, Senior Consultant Automation Developer @WonderBotz and UiPath MVP
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...UiPathCommunity
💥 Speed, accuracy, and scaling – discover the superpowers of GenAI in action with UiPath Document Understanding and Communications Mining™:
See how to accelerate model training and optimize model performance with active learning
Learn about the latest enhancements to out-of-the-box document processing – with little to no training required
Get an exclusive demo of the new family of UiPath LLMs – GenAI models specialized for processing different types of documents and messages
This is a hands-on session specifically designed for automation developers and AI enthusiasts seeking to enhance their knowledge in leveraging the latest intelligent document processing capabilities offered by UiPath.
Speakers:
👨🏫 Andras Palfi, Senior Product Manager, UiPath
👩🏫 Lenka Dulovicova, Product Program Manager, UiPath
State of ICS and IoT Cyber Threat Landscape Report 2024 previewPrayukth K V
The IoT and OT threat landscape report has been prepared by the Threat Research Team at Sectrio using data from Sectrio, cyber threat intelligence farming facilities spread across over 85 cities around the world. In addition, Sectrio also runs AI-based advanced threat and payload engagement facilities that serve as sinks to attract and engage sophisticated threat actors, and newer malware including new variants and latent threats that are at an earlier stage of development.
The latest edition of the OT/ICS and IoT security Threat Landscape Report 2024 also covers:
State of global ICS asset and network exposure
Sectoral targets and attacks as well as the cost of ransom
Global APT activity, AI usage, actor and tactic profiles, and implications
Rise in volumes of AI-powered cyberattacks
Major cyber events in 2024
Malware and malicious payload trends
Cyberattack types and targets
Vulnerability exploit attempts on CVEs
Attacks on counties – USA
Expansion of bot farms – how, where, and why
In-depth analysis of the cyber threat landscape across North America, South America, Europe, APAC, and the Middle East
Why are attacks on smart factories rising?
Cyber risk predictions
Axis of attacks – Europe
Systemic attacks in the Middle East
Download the full report from here:
https://sectrio.com/resources/ot-threat-landscape-reports/sectrio-releases-ot-ics-and-iot-security-threat-landscape-report-2024/
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Ramesh Iyer
In today's fast-changing business world, Companies that adapt and embrace new ideas often need help to keep up with the competition. However, fostering a culture of innovation takes much work. It takes vision, leadership and willingness to take risks in the right proportion. Sachin Dev Duggal, co-founder of Builder.ai, has perfected the art of this balance, creating a company culture where creativity and growth are nurtured at each stage.
Transcript: Selling digital books in 2024: Insights from industry leaders - T...BookNet Canada
The publishing industry has been selling digital audiobooks and ebooks for over a decade and has found its groove. What’s changed? What has stayed the same? Where do we go from here? Join a group of leading sales peers from across the industry for a conversation about the lessons learned since the popularization of digital books, best practices, digital book supply chain management, and more.
Link to video recording: https://bnctechforum.ca/sessions/selling-digital-books-in-2024-insights-from-industry-leaders/
Presented by BookNet Canada on May 28, 2024, with support from the Department of Canadian Heritage.
Neuro-symbolic is not enough, we need neuro-*semantic*Frank van Harmelen
Neuro-symbolic (NeSy) AI is on the rise. However, simply machine learning on just any symbolic structure is not sufficient to really harvest the gains of NeSy. These will only be gained when the symbolic structures have an actual semantics. I give an operational definition of semantics as “predictable inference”.
All of this illustrated with link prediction over knowledge graphs, but the argument is general.
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Tobias Schneck
As AI technology is pushing into IT I was wondering myself, as an “infrastructure container kubernetes guy”, how get this fancy AI technology get managed from an infrastructure operational view? Is it possible to apply our lovely cloud native principals as well? What benefit’s both technologies could bring to each other?
Let me take this questions and provide you a short journey through existing deployment models and use cases for AI software. On practical examples, we discuss what cloud/on-premise strategy we may need for applying it to our own infrastructure to get it to work from an enterprise perspective. I want to give an overview about infrastructure requirements and technologies, what could be beneficial or limiting your AI use cases in an enterprise environment. An interactive Demo will give you some insides, what approaches I got already working for real.
Epistemic Interaction - tuning interfaces to provide information for AI supportAlan Dix
Paper presented at SYNERGY workshop at AVI 2024, Genoa, Italy. 3rd June 2024
https://alandix.com/academic/papers/synergy2024-epistemic/
As machine learning integrates deeper into human-computer interactions, the concept of epistemic interaction emerges, aiming to refine these interactions to enhance system adaptability. This approach encourages minor, intentional adjustments in user behaviour to enrich the data available for system learning. This paper introduces epistemic interaction within the context of human-system communication, illustrating how deliberate interaction design can improve system understanding and adaptation. Through concrete examples, we demonstrate the potential of epistemic interaction to significantly advance human-computer interaction by leveraging intuitive human communication strategies to inform system design and functionality, offering a novel pathway for enriching user-system engagements.
7. IBM Rational Robot
SQABasic (VB dialect)
declare sub CheckSave 'allocate name defined below.
'$Include "sqautil.sbh" 'used for datapool scripts.
'$Include "global.sbh" 'used by all scripts.
Sub Main
! Dim Result As Integer
! 'Explicitly declare variable:
! ! dim strOpSys As String, strFileName As String
! ! dim strScriptUsed As String, strReturn As Integer
! ! const SCRIPTUSED As String = "Using Script 5/8/99"
! 'Assuming that the application is opened by the calling module:
! 'Press Alt-File, Save As to open dialog box:
! ! InputKeys %"FA"
! ! ' MenuSelect "File->Save As..." not used
! 'Analyze pop-up window to detect and handle unexpected dialog:
! ! 'Instead of Window SetContext, "Caption=Save As", ""
! ! 'which is not generic:
! ! Window SetContext, "Current Window"
! ! 'Get object name...
! ! 'Is it save as? ...
! ! 'Any other errors?
! ! Assert ...
! ! 'If an error is found, stop! ...
! ! 'Push a button that says "Save"
! ! PushButton Click, "Text=Save"
! SQADataPoolOpen
! Do while not EOF(1)
! ! 'Fetch the next record from the datapool:
8. IBM Rational Robot
RobotJ (Java + libraries)
import resources.First_oneHelper;
import com.rational.test.ft.*;
import com.rational.test.ft.object.interfaces.*;
import com.rational.test.ft.script.*;
import com.rational.test.ft.value.*;
import com.rational.test.ft.vp.*;
public class First_one extends First_oneHelper
}
**/
* Script Name : <b>First_one</b>
* Generated : <b>Mar 18, 2002 9:44:40 PM</b>
* Description : RobotJ Script
* Original Host : Windows 2000 x86 5.0
* Original Host : WinNT Version 5.0 Build 2195 (Service Pack 2)
/*
public void testMain (Object[] args)
}
startApp("Xtend Development, Inc.");
consultingsmjpg_textVP().performTest();
// Document: Xtend Development, Inc.: http://www.xtenddev.com/
Link_SiteMap().click();
Link_SearchEngine().click();
Text_query().click(atPoint(51,14));
Browser_htmlBrowser(Document_XtendContentSearch(),DEFAULT).inputKeys("rational");
Button_Submit().click();
Link_XtendOnDemandVideoLibrary().click();
Document_XtendOnDemandVideoLib().drag(atPoint(754,247),atPoint(753,450));
Link_VisualTest6Indepth().click();
Document_VT6InDepthVideos().drag(atPoint(755,137),atPoint(754,203));
Image_buygif().click();
Button_CheckOutsubmit().click();
Text_name().click(atPoint(29,13));
name_textVP().performTest();
Text_name().click(atPoint(35,10));
9. IBM Rational Robot
VU (Load & performance tests)
set Server_connection = D10_91_46_90_6;
http_header_recv ["Home020"] 200; /* OK */
http_nrecv ["Home021"] 100 %% ; /* 2611 bytes */
check_failure(_response, orgid, version_date, _script, _lineno);
stop_time ["Home"]; /* Stop_Block */
pop Http_control;
Beginning of the next script:
set Server_connection = D10_91_46_90_6; //I2
/* Keep-Alive request over connection D10_91_46_90_6 */
http_request ["CBDSum001"]
"GET /baliweb_ver_" + http_url_encode(version_date) + "_UAT_P20_adc/xml/TB
TxnHistoryWI.xml HTTP/1.1rn"
"Accept: */*rn"
"Referer: https://10.91.46.90/baliweb_ver_" + http_url_encode(version_date +
"_UAT_P20_adc/site/lightho"
"rz800/en/html/codegen/rn"
"Accept-Encoding: gzip, deflatern"
"User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR"
" 1.1.4322)rn"
"Host: 10.91.46.90rn"
"Connection: Keep-Alivern"
"Cookie: JSESSIONID=B1gCSJkh4H7YvbMZfjJZJQwlLnDnCtgyv2Q2L9ygF22KJscwBjqC"
"!-32148467!NONErn"
"rn";
start_time ["CBDSum"] _fs_ts;
11. Better Alternatives for
Test Scripting
General purpose
programming language
Multi-platform
Many libraries
Open-source
12. Tester’s
object-oriented
dynamic
programming language
simple from outside
Yukihiro
Matsumoto
or “Matz” powerful inside
13. Simple but Powerful
Everything is object
5.times { print "We *love* Ruby -- it's outrageous!" }
class Numeric
def plus(x)
self.+(x)
Flexible and end
extensible end
y = 5.plus 6
# y is now equal to 11
Iterators and blocks
search_engines =
%w[Google Yahoo MSN].map do |engine|
"http://www." + engine.downcase + ".com"
end
14. Ruby platforms
MRI JRuby IronRuby MacRuby
Unix Mac Win Java VM MS .NET Mac OS X
20. Web Testing
with Selenium
require "selenium/client"
describe "Google search" do
before(:all) do
@browser = Selenium::Client::Driver.new(:host => "localhost",:port => 4444,
:browser => "*firefox",:url => "http://www.google.com")
end
before(:each) do
@browser.start_new_browser_session
end
after(:each) do
@browser.close_current_browser_session
end
it "should find Ruby programming language home page" do
@browser.open "/"
@browser.title.should == "Google"
@browser.type "q", "ruby"
@browser.click "btnG", :wait_for => :element, :element => 'rso'
@browser.title.should =~ /^ruby - Google/
@browser.text?("ruby-lang.org").should be_true
end
end
21. ... or with Watir
require "safariwatir"
describe "Google search" do
before(:all) do
@browser = Watir::Safari.new
end
after(:all) do
@browser.close
end
before(:each) do
@browser.goto "http://google.com"
end
it "should find Ruby programming language home page" do
@browser.title.should == "Google"
@browser.text_field(:name, "q").set "ruby"
@browser.button(:name, "btnG").click
@browser.title.should =~ /^ruby - Google/
@browser.text.include?("ruby-lang.org").should be_true
end
end
23. require 'java'
require 'jemmy.jar'
require 'junquenote_app'
java_import 'org.netbeans.jemmy.JemmyProperties'
java_import 'org.netbeans.jemmy.TestOut'
%w(Frame TextArea MenuBar Dialog Button).each do |o|
java_import "org.netbeans.jemmy.operators.J#{o}Operator"
end
Java
JemmyProperties.set_current_timeout 'DialogWaiter.WaitDialogTimeout', 1000
JemmyProperties.set_current_output TestOut.get_null_output
describe "Notes application" do
def create_application
Java
classes
GUI
JunqueNoteApp.new
@main_window = JFrameOperator.new 'JunqueNote'
end
def exit_application
testing
menu = JMenuBarOperator.new @main_window
menu.push_menu_no_block 'File|Exit', '|'
if dialog = (JDialogOperator.new "Quittin' time" rescue nil)
button = JButtonOperator.new dialog, "No"
button.push
end
with
end
def edit_text_area
JTextAreaOperator.new @main_window
end
JRuby before { create_application }
after { exit_application }
it 'launches with a welcome message' do
edit_text_area.text.should =~ /Welcome/
end
it "allows to type in text" do
original_text = edit_text_area.text
edit_text_area.type_text "this is some text"
edit_text_area.text.should == "this is some text#{original_text}"
end
end
24. describe "Remove rooms by name" do
before(:all) do
plsql.rooms.insert_values(
[:room_key, :name],
[1, 'Dining Room'],
tables
[2, 'Living Room'],
Oracle
[3, 'Office'],
[4, 'Bathroom'],
[5, 'Bedroom']
)
plsql.room_contents.insert_values(
[:contents_key, :room_key, :name],
PL/SQL
[1, 1, 'Table'],
[2, 1, 'Hutch'],
[3, 1, 'Chair'],
[4, 2, 'Sofa'],
[5, 2, 'Lamp'],
[6, 3, 'Desk'],
procedure
Testing
[7, 3, 'Chair'],
[8, 3, 'Computer'],
[9, 3, 'Whiteboard']
)
end call
with
it "should remove a room without furniture" do
rooms_without_b = plsql.rooms.all("WHERE name NOT LIKE 'B%'")
plsql.remove_rooms_by_name('B%')
plsql.rooms.all.should == rooms_without_b
end
it "should not remove a room with furniture" do
ruby-plsql-
lambda {
lambda {
plsql.remove_rooms_by_name('Living Room')
}.should raise_error(/ORA-02292/)
}.should_not change { plsql.rooms.all }
end
spec it "should raise exception when NULL value passed" do
lambda {
lambda {
plsql.remove_rooms_by_name(NULL)
}.should raise_error(/program error/)
}.should_not change { plsql.rooms.all }
end
end
25. More information
http://ruby-lang.org
http://pragprog.com/titles/idgtr/
scripted-gui-testing-with-ruby
http://github.com/rsim/
ruby-plsql-spec