SlideShare una empresa de Scribd logo
1 de 29
Test Automation with Cucumber JVM,
Selenium, and Mocha
Sanjay Gidwani, Salesforce.com, Director @gidzone
Shuji Ui, Sonoma Partners, Technical Solution Architect @shujiui
Safe harbor
Safe harbor statement under the Private Securities Litigation Reform Act of 1995:
This presentation may contain forward-looking statements that involve risks, uncertainties, and assumptions. If any such uncertainties
materialize or if any of the assumptions proves incorrect, the results of salesforce.com, inc. could differ materially from the results
expressed or implied by the forward-looking statements we make. All statements other than statements of historical fact could be
deemed forward-looking, including any projections of product or service availability, subscriber growth, earnings, revenues, or other
financial items and any statements regarding strategies or plans of management for future operations, statements of belief, any
statements concerning new, planned, or upgraded services or technology developments and customer contracts or use of our services.
The risks and uncertainties referred to above include – but are not limited to – risks associated with developing and delivering new
functionality for our service, new products and services, our new business model, our past operating losses, possible fluctuations in our
operating results and rate of growth, interruptions or delays in our Web hosting, breach of our security measures, the outcome of any
litigation, risks associated with completed and any possible mergers and acquisitions, the immature market in which we operate, our
relatively limited operating history, our ability to expand, retain, and motivate our employees and manage our growth, new releases of
our service and successful customer deployment, our limited history reselling non-salesforce.com products, and utilization and selling to
larger enterprise customers. Further information on potential factors that could affect the financial results of salesforce.com, inc. is
included in our annual report on Form 10-K for the most recent fiscal year and in our quarterly report on Form 10-Q for the most recent
fiscal quarter. These documents and others containing important disclosures are available on the SEC Filings section of the Investor
Information section of our Web site.
Any unreleased services or features referenced in this or other presentations, press releases or public statements are not currently
available and may not be delivered on time or at all. Customers who purchase our services should make the purchase decisions
based upon features that are currently available. Salesforce.com, inc. assumes no obligation and does not intend to update these
forward-looking statements.
Shuji Ui
Sonoma Partners
Salesforce.com Technical Solution Architect
@shujiui
Sanjay Gidwani
Salesforce.com
Director of Salesforce.com team
@gidzone
Agenda
• Why test automation is important in Agile development?
• What is BDD?
• How did we automate tests?
 Cucumber JVM + Selenium
 Mocha
 Jenkins
Agile project and automation
• How many people are in Agile project right now?
• Does your development team write unit tests for non-Apex code?
• Does your QA team automate E2E tests?
• Continuous Integration?
Sprint 13 Agile project experience
• Each sprint is 2 weeks, 13 sprints Agile project
• Custom Visualforce / JavaScript project
• 5 developers + 3 QA + 1.5 QA automation developer
• JavaScript unit tests with Mocha
• Regression testing automation using Cucumber JVM + Selenium
 1.5 developers worked on implementing automation scripts and
code
 Write automation for previous sprint
Behavior-Driven Development
• By writing specs/test cases in plain text, developers, business analysts, and QAs
with shared tools and a shared process to collaborate on software development.
• Based on test-driven development – Write test first
http://en.wikipedia.org/wiki/Behavior-driven_development

Frameworks
Jasmine for JavaScript unit tests - http://pivotal.github.io/jasmine/
Mocha for JavaScript unit tests - http://visionmedia.github.io/mocha/
Cucumber for E2E tests - http://cukes.info/
Frank for iOS with Cucumber - http://www.testingwithfrank.com/
Cucumber JVM
Cucumber
•A testing framework based on BDD (Behavior-driven development)
•Writing test cases in plain text and then Cucumber generates Ruby, Java, .Net, Flex codes
•Generate reports
•Written in Ruby
http://cukes.info/
Cucumber JVM
A pure Java implementation of Cucumber
https://github.com/cucumber/cucumber-jvm
Selenium IDE and Remote Control
Selenium IDE
Firefox extension, allows you to record, edit, and debug selenium tests in
Firefox. It exports Selenium Remote Control Java code.
http://docs.seleniumhq.org/projects/ide/
Selenium Remote Control Java client and the server
Selenium Remote Control (RC) is a test tool that allows user to write automated
web application UI tests.
Selenium Remote Control
•IE8 was the browser requirement
•We created EC2 Windows
instance.
•Runing RC server on the Windows
instance.
•RC server starts up IE8.
Mocha
• JavaScript unit test framework
• The syntax is similar to Jasmin
•

We used Mocha because we used Brunch assembler for project. The assembler
came with Mocha.

• Running on Node.js
• Comes with several reporters
http://visionmedia.github.io/mocha/
How did we use Mocha unit tests? (Sanjay)
• Running Mocha in real browser, for example, IE8.
• Used for UI testing, e.g. filtering, displaying error based
on a condition…etc.
• QA Lead communicated to QA engineers and
developers to balance Mocha UI unit tests and e2e test
using Cucumber JVM + Selenium.
• Can generate report.
Continuous Integration with Jenkins (Sanjay)
•
•
•
•
•

Open source Continuous Integration tool written in Java.
The project was forked from Hudson.
Easy to set up and running.
Active plugin community.
Our team installed Jenkins in our EC2 Ubuntu instance.

http://jenkins-ci.org/
Cucumber JVM Jenkins Plugin
https://github.com/masterthought/jenkins-cucumber-jvm-reports-plugin-java
Demo: Testing Flexible Contact Chatter-Follow Sample
App with Cucumber JVM and Selenium
• Flexible Contact Chatter-Follow Sample App
• Write specs/tests in plain text and convert them to Java
code snippets.
• Selenium IDE and add Selenium IDE generated JUnit
code to the Java Code snippets.
• commit the code to git and run them with Jenkins.
• Cucumber JVM report.
Flexible Chatter Contact Follow App
1. One of our clients wants to use “Sync contacts users
follow in Chatter” option in Salesforce to Outlook
configurations
2. They want an app to make their assistants to control
chatter-follow for other people.
Flexible Chatter Contact Follow App Solution
1. Created a “Contacts Relationship” custom object as a
junction object between “Contact” and “User” objects.
2. When a “Contacts Relationship” record is created, an
Apex trigger is fired to make “User” follow “Contact”
relationship in Chatter.
User

Contacts Relationship

Contact

First Name

User

Name

Last Name

Contact

Account Name

Apex Trigger on"Contacts Relationship"
Agile project: Sprint 1 and User Story 001
Suppose we are in Sprint 1 of an Agile project and the Flex
Contact Chatter-Follow is User Story 001.
Here is what to do before writing code:
1. BA and TA gather requirements from client.
2. TA and Dev design solution and create mockup/diagram.
3. BA and Dev writes scenarios and confirm with QA.
4. QA writes test cases and confirms with BA and Dev.
BA, QA, and Dev write tests in plain text
Cucumber JVM generates snippets from the plain text
case
Selenium IDE to record a test case
Export JUnit code from Selenium IDE
Merge Selenium generated code to Cucumber generated
snippets
Dynamic generated IDs in SFDC
• When a client wants to run integration automation code in
2 different sandbox orgs. HTML DOM ids are different
between 2 sandbox orgs.

Workaround
• xpath option in Selenium instead of using IDs to locate
HTML tags.
•

QA automation developers need to learn xpath.

•

Depending on page xpath is difficult to maintain.
Run the test cases in Jenkins and generates report
Running Mocha and generating the report
Conclusion
End of the 13 sprints, QA developers wrote e2e test code for
about 90 User Stories and more than 200 test cases.
Developers wrote unit tests for all User Stories.
Jenkins run nightly and send report to QA/Dev team. The
automation saved significant amount of QA time and
delivered quality code to the client.
Sanjay Gidwani

Shuji Ui

Director
Salesforce.com
@gidzone

Technical Solution Architect
Sonoma Partners
@shujiui
Test Automation With Cucumber JVM, Selenium, and Mocha

Más contenido relacionado

La actualidad más candente

Selenium with Cucumber
Selenium  with Cucumber Selenium  with Cucumber
Selenium with Cucumber Knoldus Inc.
 
End to end test automation with cypress
End to end test automation with cypressEnd to end test automation with cypress
End to end test automation with cypressPankajSingh184960
 
Cypress vs Selenium WebDriver: Better, Or Just Different? -- by Gil Tayar
Cypress vs Selenium WebDriver: Better, Or Just Different? -- by Gil TayarCypress vs Selenium WebDriver: Better, Or Just Different? -- by Gil Tayar
Cypress vs Selenium WebDriver: Better, Or Just Different? -- by Gil TayarApplitools
 
Getting Started With Cypress
Getting Started With CypressGetting Started With Cypress
Getting Started With CypressKnoldus Inc.
 
e2e testing with cypress
e2e testing with cypresse2e testing with cypress
e2e testing with cypressTomasz Bak
 
Test Automation Framework using Cucumber BDD overview (part 1)
Test Automation Framework using Cucumber BDD overview (part 1)Test Automation Framework using Cucumber BDD overview (part 1)
Test Automation Framework using Cucumber BDD overview (part 1)Mindfire Solutions
 
Introduction to Bdd and cucumber
Introduction to Bdd and cucumberIntroduction to Bdd and cucumber
Introduction to Bdd and cucumberNibu Baby
 
automation framework
automation frameworkautomation framework
automation frameworkANSHU GOYAL
 
Behavior Driven Development Pros and Cons
Behavior Driven Development Pros and ConsBehavior Driven Development Pros and Cons
Behavior Driven Development Pros and ConsIosif Itkin
 
Manual Testing Material by Durgasoft
Manual Testing Material by DurgasoftManual Testing Material by Durgasoft
Manual Testing Material by DurgasoftDurga Prasad
 
Web Test Automation with Selenium
Web Test Automation with SeleniumWeb Test Automation with Selenium
Web Test Automation with Seleniumvivek_prahlad
 
Behavior Driven Development and Automation Testing Using Cucumber
Behavior Driven Development and Automation Testing Using CucumberBehavior Driven Development and Automation Testing Using Cucumber
Behavior Driven Development and Automation Testing Using CucumberKMS Technology
 
Selenium Automation Testing Interview Questions And Answers
Selenium Automation Testing Interview Questions And AnswersSelenium Automation Testing Interview Questions And Answers
Selenium Automation Testing Interview Questions And AnswersAjit Jadhav
 
SonarQube - The leading platform for Continuous Code Quality
SonarQube - The leading platform for Continuous Code QualitySonarQube - The leading platform for Continuous Code Quality
SonarQube - The leading platform for Continuous Code QualityLarry Nung
 
RESTful API Testing using Postman, Newman, and Jenkins
RESTful API Testing using Postman, Newman, and JenkinsRESTful API Testing using Postman, Newman, and Jenkins
RESTful API Testing using Postman, Newman, and JenkinsQASymphony
 

La actualidad más candente (20)

Selenium with Cucumber
Selenium  with Cucumber Selenium  with Cucumber
Selenium with Cucumber
 
End to end test automation with cypress
End to end test automation with cypressEnd to end test automation with cypress
End to end test automation with cypress
 
Cypress vs Selenium WebDriver: Better, Or Just Different? -- by Gil Tayar
Cypress vs Selenium WebDriver: Better, Or Just Different? -- by Gil TayarCypress vs Selenium WebDriver: Better, Or Just Different? -- by Gil Tayar
Cypress vs Selenium WebDriver: Better, Or Just Different? -- by Gil Tayar
 
Getting Started With Cypress
Getting Started With CypressGetting Started With Cypress
Getting Started With Cypress
 
e2e testing with cypress
e2e testing with cypresse2e testing with cypress
e2e testing with cypress
 
Cypress testing
Cypress testingCypress testing
Cypress testing
 
Jenkins presentation
Jenkins presentationJenkins presentation
Jenkins presentation
 
Test Automation Framework using Cucumber BDD overview (part 1)
Test Automation Framework using Cucumber BDD overview (part 1)Test Automation Framework using Cucumber BDD overview (part 1)
Test Automation Framework using Cucumber BDD overview (part 1)
 
Introduction to Bdd and cucumber
Introduction to Bdd and cucumberIntroduction to Bdd and cucumber
Introduction to Bdd and cucumber
 
Cucumber presenation
Cucumber presenationCucumber presenation
Cucumber presenation
 
automation framework
automation frameworkautomation framework
automation framework
 
Behavior Driven Development Pros and Cons
Behavior Driven Development Pros and ConsBehavior Driven Development Pros and Cons
Behavior Driven Development Pros and Cons
 
Introduction to Selenium Web Driver
Introduction to Selenium Web DriverIntroduction to Selenium Web Driver
Introduction to Selenium Web Driver
 
Manual Testing Material by Durgasoft
Manual Testing Material by DurgasoftManual Testing Material by Durgasoft
Manual Testing Material by Durgasoft
 
Web Test Automation with Selenium
Web Test Automation with SeleniumWeb Test Automation with Selenium
Web Test Automation with Selenium
 
Behavior Driven Development and Automation Testing Using Cucumber
Behavior Driven Development and Automation Testing Using CucumberBehavior Driven Development and Automation Testing Using Cucumber
Behavior Driven Development and Automation Testing Using Cucumber
 
Selenium Automation Testing Interview Questions And Answers
Selenium Automation Testing Interview Questions And AnswersSelenium Automation Testing Interview Questions And Answers
Selenium Automation Testing Interview Questions And Answers
 
SonarQube - The leading platform for Continuous Code Quality
SonarQube - The leading platform for Continuous Code QualitySonarQube - The leading platform for Continuous Code Quality
SonarQube - The leading platform for Continuous Code Quality
 
Cucumber & gherkin language
Cucumber & gherkin languageCucumber & gherkin language
Cucumber & gherkin language
 
RESTful API Testing using Postman, Newman, and Jenkins
RESTful API Testing using Postman, Newman, and JenkinsRESTful API Testing using Postman, Newman, and Jenkins
RESTful API Testing using Postman, Newman, and Jenkins
 

Similar a Test Automation With Cucumber JVM, Selenium, and Mocha

DevOps in Salesforce AppCloud
DevOps in Salesforce AppCloudDevOps in Salesforce AppCloud
DevOps in Salesforce AppCloudrsg00usa
 
Self-Service Secure Test and Release Pipelines
Self-Service Secure Test and Release PipelinesSelf-Service Secure Test and Release Pipelines
Self-Service Secure Test and Release PipelinesSalesforce Engineering
 
Lightning web components - Episode 4 : Security and Testing
Lightning web components  - Episode 4 : Security and TestingLightning web components  - Episode 4 : Security and Testing
Lightning web components - Episode 4 : Security and TestingSalesforce Developers
 
Introduction to Javascript Unit Testing With xUnit.js
Introduction to Javascript Unit Testing With xUnit.jsIntroduction to Javascript Unit Testing With xUnit.js
Introduction to Javascript Unit Testing With xUnit.jsSalesforce Developers
 
Sandboxes: The Future of App Development by Evan Barnet & Pam Barnet
Sandboxes: The Future of App Development by Evan Barnet & Pam BarnetSandboxes: The Future of App Development by Evan Barnet & Pam Barnet
Sandboxes: The Future of App Development by Evan Barnet & Pam BarnetSalesforce Admins
 
TDX19 - Accelerate DevOps with GitLab and Salesforce
TDX19 - Accelerate DevOps with GitLab and SalesforceTDX19 - Accelerate DevOps with GitLab and Salesforce
TDX19 - Accelerate DevOps with GitLab and SalesforceDoug Ayers
 
How Developers and Quality Engineer Collaborate at Salesforce
How Developers and Quality Engineer Collaborate at SalesforceHow Developers and Quality Engineer Collaborate at Salesforce
How Developers and Quality Engineer Collaborate at SalesforceSalesforce Engineering
 
Enterprise-grade UI with open source Lightning Web Components
Enterprise-grade UI with open source Lightning Web ComponentsEnterprise-grade UI with open source Lightning Web Components
Enterprise-grade UI with open source Lightning Web ComponentsSalesforce Developers
 
Lightning web components - Episode 1 - An Introduction
Lightning web components - Episode 1 - An IntroductionLightning web components - Episode 1 - An Introduction
Lightning web components - Episode 1 - An IntroductionSalesforce Developers
 
Meet The Welkin Suite IDE: Product Overview
Meet The Welkin Suite IDE: Product OverviewMeet The Welkin Suite IDE: Product Overview
Meet The Welkin Suite IDE: Product OverviewSalesforce Developers
 
Hands-on Workshop: Intermediate Development with Heroku and Force.com
Hands-on Workshop: Intermediate Development with Heroku and Force.comHands-on Workshop: Intermediate Development with Heroku and Force.com
Hands-on Workshop: Intermediate Development with Heroku and Force.comSalesforce Developers
 
AngularJS App In Two Weeks
AngularJS App In Two WeeksAngularJS App In Two Weeks
AngularJS App In Two WeeksPeter Chittum
 
Java Best Practices - Tools, Performance, and Deployment
Java Best Practices - Tools, Performance, and DeploymentJava Best Practices - Tools, Performance, and Deployment
Java Best Practices - Tools, Performance, and DeploymentSalesforce Developers
 
Building einstein analytics apps uk-compressed
Building einstein analytics apps   uk-compressedBuilding einstein analytics apps   uk-compressed
Building einstein analytics apps uk-compressedrikkehovgaard
 
Building JavaScript Applications on the Salesforce1 Platform
Building JavaScript Applications on the Salesforce1 PlatformBuilding JavaScript Applications on the Salesforce1 Platform
Building JavaScript Applications on the Salesforce1 PlatformSalesforce Developers
 
San Francisco Jenkins Area Meetup October 2016: Self-service secure test and ...
San Francisco Jenkins Area Meetup October 2016: Self-service secure test and ...San Francisco Jenkins Area Meetup October 2016: Self-service secure test and ...
San Francisco Jenkins Area Meetup October 2016: Self-service secure test and ...Andrey Falko
 
Salesforce API Series: Release Management with the Metadata API webinar
Salesforce API Series: Release Management with the Metadata API webinarSalesforce API Series: Release Management with the Metadata API webinar
Salesforce API Series: Release Management with the Metadata API webinarSalesforce Developers
 

Similar a Test Automation With Cucumber JVM, Selenium, and Mocha (20)

Ashish Baraiya
Ashish BaraiyaAshish Baraiya
Ashish Baraiya
 
DevOps in Salesforce AppCloud
DevOps in Salesforce AppCloudDevOps in Salesforce AppCloud
DevOps in Salesforce AppCloud
 
Self-Service Secure Test and Release Pipelines
Self-Service Secure Test and Release PipelinesSelf-Service Secure Test and Release Pipelines
Self-Service Secure Test and Release Pipelines
 
Lightning web components - Episode 4 : Security and Testing
Lightning web components  - Episode 4 : Security and TestingLightning web components  - Episode 4 : Security and Testing
Lightning web components - Episode 4 : Security and Testing
 
Introduction to Javascript Unit Testing With xUnit.js
Introduction to Javascript Unit Testing With xUnit.jsIntroduction to Javascript Unit Testing With xUnit.js
Introduction to Javascript Unit Testing With xUnit.js
 
Sandboxes: The Future of App Development by Evan Barnet & Pam Barnet
Sandboxes: The Future of App Development by Evan Barnet & Pam BarnetSandboxes: The Future of App Development by Evan Barnet & Pam Barnet
Sandboxes: The Future of App Development by Evan Barnet & Pam Barnet
 
TDX19 - Accelerate DevOps with GitLab and Salesforce
TDX19 - Accelerate DevOps with GitLab and SalesforceTDX19 - Accelerate DevOps with GitLab and Salesforce
TDX19 - Accelerate DevOps with GitLab and Salesforce
 
How Developers and Quality Engineer Collaborate at Salesforce
How Developers and Quality Engineer Collaborate at SalesforceHow Developers and Quality Engineer Collaborate at Salesforce
How Developers and Quality Engineer Collaborate at Salesforce
 
Enterprise-grade UI with open source Lightning Web Components
Enterprise-grade UI with open source Lightning Web ComponentsEnterprise-grade UI with open source Lightning Web Components
Enterprise-grade UI with open source Lightning Web Components
 
Lightning web components - Episode 1 - An Introduction
Lightning web components - Episode 1 - An IntroductionLightning web components - Episode 1 - An Introduction
Lightning web components - Episode 1 - An Introduction
 
Meet The Welkin Suite IDE: Product Overview
Meet The Welkin Suite IDE: Product OverviewMeet The Welkin Suite IDE: Product Overview
Meet The Welkin Suite IDE: Product Overview
 
Hands-on Workshop: Intermediate Development with Heroku and Force.com
Hands-on Workshop: Intermediate Development with Heroku and Force.comHands-on Workshop: Intermediate Development with Heroku and Force.com
Hands-on Workshop: Intermediate Development with Heroku and Force.com
 
AngularJS App In Two Weeks
AngularJS App In Two WeeksAngularJS App In Two Weeks
AngularJS App In Two Weeks
 
Java Best Practices - Tools, Performance, and Deployment
Java Best Practices - Tools, Performance, and DeploymentJava Best Practices - Tools, Performance, and Deployment
Java Best Practices - Tools, Performance, and Deployment
 
Summer '18 Developer Highlights
Summer '18 Developer HighlightsSummer '18 Developer Highlights
Summer '18 Developer Highlights
 
Building einstein analytics apps uk-compressed
Building einstein analytics apps   uk-compressedBuilding einstein analytics apps   uk-compressed
Building einstein analytics apps uk-compressed
 
Building JavaScript Applications on the Salesforce1 Platform
Building JavaScript Applications on the Salesforce1 PlatformBuilding JavaScript Applications on the Salesforce1 Platform
Building JavaScript Applications on the Salesforce1 Platform
 
San Francisco Jenkins Area Meetup October 2016: Self-service secure test and ...
San Francisco Jenkins Area Meetup October 2016: Self-service secure test and ...San Francisco Jenkins Area Meetup October 2016: Self-service secure test and ...
San Francisco Jenkins Area Meetup October 2016: Self-service secure test and ...
 
Ravi_Nelluri_QA
Ravi_Nelluri_QARavi_Nelluri_QA
Ravi_Nelluri_QA
 
Salesforce API Series: Release Management with the Metadata API webinar
Salesforce API Series: Release Management with the Metadata API webinarSalesforce API Series: Release Management with the Metadata API webinar
Salesforce API Series: Release Management with the Metadata API webinar
 

Más de Salesforce Developers

Sample Gallery: Reference Code and Best Practices for Salesforce Developers
Sample Gallery: Reference Code and Best Practices for Salesforce DevelopersSample Gallery: Reference Code and Best Practices for Salesforce Developers
Sample Gallery: Reference Code and Best Practices for Salesforce DevelopersSalesforce Developers
 
Maximizing Salesforce Lightning Experience and Lightning Component Performance
Maximizing Salesforce Lightning Experience and Lightning Component PerformanceMaximizing Salesforce Lightning Experience and Lightning Component Performance
Maximizing Salesforce Lightning Experience and Lightning Component PerformanceSalesforce Developers
 
Local development with Open Source Base Components
Local development with Open Source Base ComponentsLocal development with Open Source Base Components
Local development with Open Source Base ComponentsSalesforce Developers
 
TrailheaDX India : Developer Highlights
TrailheaDX India : Developer HighlightsTrailheaDX India : Developer Highlights
TrailheaDX India : Developer HighlightsSalesforce Developers
 
Why developers shouldn’t miss TrailheaDX India
Why developers shouldn’t miss TrailheaDX IndiaWhy developers shouldn’t miss TrailheaDX India
Why developers shouldn’t miss TrailheaDX IndiaSalesforce Developers
 
CodeLive: Build Lightning Web Components faster with Local Development
CodeLive: Build Lightning Web Components faster with Local DevelopmentCodeLive: Build Lightning Web Components faster with Local Development
CodeLive: Build Lightning Web Components faster with Local DevelopmentSalesforce Developers
 
CodeLive: Converting Aura Components to Lightning Web Components
CodeLive: Converting Aura Components to Lightning Web ComponentsCodeLive: Converting Aura Components to Lightning Web Components
CodeLive: Converting Aura Components to Lightning Web ComponentsSalesforce Developers
 
TrailheaDX and Summer '19: Developer Highlights
TrailheaDX and Summer '19: Developer HighlightsTrailheaDX and Summer '19: Developer Highlights
TrailheaDX and Summer '19: Developer HighlightsSalesforce Developers
 
LWC Episode 3- Component Communication and Aura Interoperability
LWC Episode 3- Component Communication and Aura InteroperabilityLWC Episode 3- Component Communication and Aura Interoperability
LWC Episode 3- Component Communication and Aura InteroperabilitySalesforce Developers
 
Lightning web components episode 2- work with salesforce data
Lightning web components   episode 2- work with salesforce dataLightning web components   episode 2- work with salesforce data
Lightning web components episode 2- work with salesforce dataSalesforce Developers
 
Migrating CPQ to Advanced Calculator and JSQCP
Migrating CPQ to Advanced Calculator and JSQCPMigrating CPQ to Advanced Calculator and JSQCP
Migrating CPQ to Advanced Calculator and JSQCPSalesforce Developers
 
Scale with Large Data Volumes and Big Objects in Salesforce
Scale with Large Data Volumes and Big Objects in SalesforceScale with Large Data Volumes and Big Objects in Salesforce
Scale with Large Data Volumes and Big Objects in SalesforceSalesforce Developers
 
Replicate Salesforce Data in Real Time with Change Data Capture
Replicate Salesforce Data in Real Time with Change Data CaptureReplicate Salesforce Data in Real Time with Change Data Capture
Replicate Salesforce Data in Real Time with Change Data CaptureSalesforce Developers
 
Modern Development with Salesforce DX
Modern Development with Salesforce DXModern Development with Salesforce DX
Modern Development with Salesforce DXSalesforce Developers
 
Integrate CMS Content Into Lightning Communities with CMS Connect
Integrate CMS Content Into Lightning Communities with CMS ConnectIntegrate CMS Content Into Lightning Communities with CMS Connect
Integrate CMS Content Into Lightning Communities with CMS ConnectSalesforce Developers
 
Modern App Dev: Modular Development Strategies
Modern App Dev: Modular Development StrategiesModern App Dev: Modular Development Strategies
Modern App Dev: Modular Development StrategiesSalesforce Developers
 

Más de Salesforce Developers (20)

Sample Gallery: Reference Code and Best Practices for Salesforce Developers
Sample Gallery: Reference Code and Best Practices for Salesforce DevelopersSample Gallery: Reference Code and Best Practices for Salesforce Developers
Sample Gallery: Reference Code and Best Practices for Salesforce Developers
 
Maximizing Salesforce Lightning Experience and Lightning Component Performance
Maximizing Salesforce Lightning Experience and Lightning Component PerformanceMaximizing Salesforce Lightning Experience and Lightning Component Performance
Maximizing Salesforce Lightning Experience and Lightning Component Performance
 
Local development with Open Source Base Components
Local development with Open Source Base ComponentsLocal development with Open Source Base Components
Local development with Open Source Base Components
 
TrailheaDX India : Developer Highlights
TrailheaDX India : Developer HighlightsTrailheaDX India : Developer Highlights
TrailheaDX India : Developer Highlights
 
Why developers shouldn’t miss TrailheaDX India
Why developers shouldn’t miss TrailheaDX IndiaWhy developers shouldn’t miss TrailheaDX India
Why developers shouldn’t miss TrailheaDX India
 
CodeLive: Build Lightning Web Components faster with Local Development
CodeLive: Build Lightning Web Components faster with Local DevelopmentCodeLive: Build Lightning Web Components faster with Local Development
CodeLive: Build Lightning Web Components faster with Local Development
 
CodeLive: Converting Aura Components to Lightning Web Components
CodeLive: Converting Aura Components to Lightning Web ComponentsCodeLive: Converting Aura Components to Lightning Web Components
CodeLive: Converting Aura Components to Lightning Web Components
 
TrailheaDX and Summer '19: Developer Highlights
TrailheaDX and Summer '19: Developer HighlightsTrailheaDX and Summer '19: Developer Highlights
TrailheaDX and Summer '19: Developer Highlights
 
Live coding with LWC
Live coding with LWCLive coding with LWC
Live coding with LWC
 
LWC Episode 3- Component Communication and Aura Interoperability
LWC Episode 3- Component Communication and Aura InteroperabilityLWC Episode 3- Component Communication and Aura Interoperability
LWC Episode 3- Component Communication and Aura Interoperability
 
Lightning web components episode 2- work with salesforce data
Lightning web components   episode 2- work with salesforce dataLightning web components   episode 2- work with salesforce data
Lightning web components episode 2- work with salesforce data
 
Migrating CPQ to Advanced Calculator and JSQCP
Migrating CPQ to Advanced Calculator and JSQCPMigrating CPQ to Advanced Calculator and JSQCP
Migrating CPQ to Advanced Calculator and JSQCP
 
Scale with Large Data Volumes and Big Objects in Salesforce
Scale with Large Data Volumes and Big Objects in SalesforceScale with Large Data Volumes and Big Objects in Salesforce
Scale with Large Data Volumes and Big Objects in Salesforce
 
Replicate Salesforce Data in Real Time with Change Data Capture
Replicate Salesforce Data in Real Time with Change Data CaptureReplicate Salesforce Data in Real Time with Change Data Capture
Replicate Salesforce Data in Real Time with Change Data Capture
 
Modern Development with Salesforce DX
Modern Development with Salesforce DXModern Development with Salesforce DX
Modern Development with Salesforce DX
 
Get Into Lightning Flow Development
Get Into Lightning Flow DevelopmentGet Into Lightning Flow Development
Get Into Lightning Flow Development
 
Integrate CMS Content Into Lightning Communities with CMS Connect
Integrate CMS Content Into Lightning Communities with CMS ConnectIntegrate CMS Content Into Lightning Communities with CMS Connect
Integrate CMS Content Into Lightning Communities with CMS Connect
 
Introduction to MuleSoft
Introduction to MuleSoftIntroduction to MuleSoft
Introduction to MuleSoft
 
Modern App Dev: Modular Development Strategies
Modern App Dev: Modular Development StrategiesModern App Dev: Modular Development Strategies
Modern App Dev: Modular Development Strategies
 
Dreamforce Developer Recap
Dreamforce Developer RecapDreamforce Developer Recap
Dreamforce Developer Recap
 

Último

#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGSujit Pal
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 

Último (20)

#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAG
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 

Test Automation With Cucumber JVM, Selenium, and Mocha

  • 1. Test Automation with Cucumber JVM, Selenium, and Mocha Sanjay Gidwani, Salesforce.com, Director @gidzone Shuji Ui, Sonoma Partners, Technical Solution Architect @shujiui
  • 2. Safe harbor Safe harbor statement under the Private Securities Litigation Reform Act of 1995: This presentation may contain forward-looking statements that involve risks, uncertainties, and assumptions. If any such uncertainties materialize or if any of the assumptions proves incorrect, the results of salesforce.com, inc. could differ materially from the results expressed or implied by the forward-looking statements we make. All statements other than statements of historical fact could be deemed forward-looking, including any projections of product or service availability, subscriber growth, earnings, revenues, or other financial items and any statements regarding strategies or plans of management for future operations, statements of belief, any statements concerning new, planned, or upgraded services or technology developments and customer contracts or use of our services. The risks and uncertainties referred to above include – but are not limited to – risks associated with developing and delivering new functionality for our service, new products and services, our new business model, our past operating losses, possible fluctuations in our operating results and rate of growth, interruptions or delays in our Web hosting, breach of our security measures, the outcome of any litigation, risks associated with completed and any possible mergers and acquisitions, the immature market in which we operate, our relatively limited operating history, our ability to expand, retain, and motivate our employees and manage our growth, new releases of our service and successful customer deployment, our limited history reselling non-salesforce.com products, and utilization and selling to larger enterprise customers. Further information on potential factors that could affect the financial results of salesforce.com, inc. is included in our annual report on Form 10-K for the most recent fiscal year and in our quarterly report on Form 10-Q for the most recent fiscal quarter. These documents and others containing important disclosures are available on the SEC Filings section of the Investor Information section of our Web site. Any unreleased services or features referenced in this or other presentations, press releases or public statements are not currently available and may not be delivered on time or at all. Customers who purchase our services should make the purchase decisions based upon features that are currently available. Salesforce.com, inc. assumes no obligation and does not intend to update these forward-looking statements.
  • 3. Shuji Ui Sonoma Partners Salesforce.com Technical Solution Architect @shujiui
  • 4. Sanjay Gidwani Salesforce.com Director of Salesforce.com team @gidzone
  • 5. Agenda • Why test automation is important in Agile development? • What is BDD? • How did we automate tests?  Cucumber JVM + Selenium  Mocha  Jenkins
  • 6. Agile project and automation • How many people are in Agile project right now? • Does your development team write unit tests for non-Apex code? • Does your QA team automate E2E tests? • Continuous Integration?
  • 7. Sprint 13 Agile project experience • Each sprint is 2 weeks, 13 sprints Agile project • Custom Visualforce / JavaScript project • 5 developers + 3 QA + 1.5 QA automation developer • JavaScript unit tests with Mocha • Regression testing automation using Cucumber JVM + Selenium  1.5 developers worked on implementing automation scripts and code  Write automation for previous sprint
  • 8. Behavior-Driven Development • By writing specs/test cases in plain text, developers, business analysts, and QAs with shared tools and a shared process to collaborate on software development. • Based on test-driven development – Write test first http://en.wikipedia.org/wiki/Behavior-driven_development Frameworks Jasmine for JavaScript unit tests - http://pivotal.github.io/jasmine/ Mocha for JavaScript unit tests - http://visionmedia.github.io/mocha/ Cucumber for E2E tests - http://cukes.info/ Frank for iOS with Cucumber - http://www.testingwithfrank.com/
  • 9. Cucumber JVM Cucumber •A testing framework based on BDD (Behavior-driven development) •Writing test cases in plain text and then Cucumber generates Ruby, Java, .Net, Flex codes •Generate reports •Written in Ruby http://cukes.info/ Cucumber JVM A pure Java implementation of Cucumber https://github.com/cucumber/cucumber-jvm
  • 10. Selenium IDE and Remote Control Selenium IDE Firefox extension, allows you to record, edit, and debug selenium tests in Firefox. It exports Selenium Remote Control Java code. http://docs.seleniumhq.org/projects/ide/ Selenium Remote Control Java client and the server Selenium Remote Control (RC) is a test tool that allows user to write automated web application UI tests.
  • 11. Selenium Remote Control •IE8 was the browser requirement •We created EC2 Windows instance. •Runing RC server on the Windows instance. •RC server starts up IE8.
  • 12. Mocha • JavaScript unit test framework • The syntax is similar to Jasmin • We used Mocha because we used Brunch assembler for project. The assembler came with Mocha. • Running on Node.js • Comes with several reporters http://visionmedia.github.io/mocha/
  • 13. How did we use Mocha unit tests? (Sanjay) • Running Mocha in real browser, for example, IE8. • Used for UI testing, e.g. filtering, displaying error based on a condition…etc. • QA Lead communicated to QA engineers and developers to balance Mocha UI unit tests and e2e test using Cucumber JVM + Selenium. • Can generate report.
  • 14. Continuous Integration with Jenkins (Sanjay) • • • • • Open source Continuous Integration tool written in Java. The project was forked from Hudson. Easy to set up and running. Active plugin community. Our team installed Jenkins in our EC2 Ubuntu instance. http://jenkins-ci.org/ Cucumber JVM Jenkins Plugin https://github.com/masterthought/jenkins-cucumber-jvm-reports-plugin-java
  • 15. Demo: Testing Flexible Contact Chatter-Follow Sample App with Cucumber JVM and Selenium • Flexible Contact Chatter-Follow Sample App • Write specs/tests in plain text and convert them to Java code snippets. • Selenium IDE and add Selenium IDE generated JUnit code to the Java Code snippets. • commit the code to git and run them with Jenkins. • Cucumber JVM report.
  • 16. Flexible Chatter Contact Follow App 1. One of our clients wants to use “Sync contacts users follow in Chatter” option in Salesforce to Outlook configurations 2. They want an app to make their assistants to control chatter-follow for other people.
  • 17. Flexible Chatter Contact Follow App Solution 1. Created a “Contacts Relationship” custom object as a junction object between “Contact” and “User” objects. 2. When a “Contacts Relationship” record is created, an Apex trigger is fired to make “User” follow “Contact” relationship in Chatter. User Contacts Relationship Contact First Name User Name Last Name Contact Account Name Apex Trigger on"Contacts Relationship"
  • 18. Agile project: Sprint 1 and User Story 001 Suppose we are in Sprint 1 of an Agile project and the Flex Contact Chatter-Follow is User Story 001. Here is what to do before writing code: 1. BA and TA gather requirements from client. 2. TA and Dev design solution and create mockup/diagram. 3. BA and Dev writes scenarios and confirm with QA. 4. QA writes test cases and confirms with BA and Dev.
  • 19. BA, QA, and Dev write tests in plain text
  • 20. Cucumber JVM generates snippets from the plain text case
  • 21. Selenium IDE to record a test case
  • 22. Export JUnit code from Selenium IDE
  • 23. Merge Selenium generated code to Cucumber generated snippets
  • 24. Dynamic generated IDs in SFDC • When a client wants to run integration automation code in 2 different sandbox orgs. HTML DOM ids are different between 2 sandbox orgs. Workaround • xpath option in Selenium instead of using IDs to locate HTML tags. • QA automation developers need to learn xpath. • Depending on page xpath is difficult to maintain.
  • 25. Run the test cases in Jenkins and generates report
  • 26. Running Mocha and generating the report
  • 27. Conclusion End of the 13 sprints, QA developers wrote e2e test code for about 90 User Stories and more than 200 test cases. Developers wrote unit tests for all User Stories. Jenkins run nightly and send report to QA/Dev team. The automation saved significant amount of QA time and delivered quality code to the client.
  • 28. Sanjay Gidwani Shuji Ui Director Salesforce.com @gidzone Technical Solution Architect Sonoma Partners @shujiui