SlideShare ist ein Scribd-Unternehmen logo
1 von 46
Downloaden Sie, um offline zu lesen
WITH GO
SMOKE TESTING
GO
GO WAS CONCEIVED WHILE
WAITING FOR C++ TO
COMPILE
it is said that
“BORN OUT OF FRUSTRATION WITH
EXISTING LANGUAGES AND
ENVIRONMENTS FOR SYSTEMS
PROGRAMMING”
2007
OPEN-SOURCED BY GOOGLE
2009
COMPILED
STATICALLY-TYPED
SOMETIMES THE TYPE IS INFERRED FROM THE CONTEXT
FOCUS ON READABILITY
AND PERFORMANCE
DESIGNED FOR GOOGLE-SCALE CODEBASES
GARBAGE-COLLECTED
NATIVE CONCURRENCY SUPPORT
COROUTINES, CHANNELS
SYNTAX ENFORCES READABILITY
NO TERNARY OPERATOR
VAR++ DOES NOT RETURN VALUE
SMART DEPENDENCY LINKING
FAST COMPILATION
WHAT DOES IT LOOK LIKE?
GAINING POPULARITY:
TESTING
FRAMEWORKS
GINGKO TEST STRUCTURE
▸ Describe()
▸ Context()
▸ It()
▸ By()
▸ Describe()
▸ …
THE USUAL
▸ BeforeSuite()
▸ BeforeEach()
▸ AfterEach()
▸ AfterSuite()
FOCUSED SPECS
▸ FDescribe()
▸ FContext()
▸ FIt()
RUNNING TEST SUITE
go test
MAKING ASSERTIONS
‣ Expect(ACTUAL).To(Equal(EXPECTED))
‣ Expect(ACTUAL).NotTo(Equal(EXPECTED))
‣ Expect(ACTUAL).ToNot(Equal(EXPECTED))
ASSERTING EQUIVALENCE
‣ Equal(...)
‣ BeEquivalentTo(...)
‣ BeAssignableToTypeOf(...)
ASSERTING PRESENCE
‣ BeNil()
‣ BeZero()
ASSERTING TRUTHINESS
‣ BeTrue()
‣ BeFalse()
ASSERTING ON ERRORS
‣ HaveOccurred()
‣ Succeed()
‣ MatchError(...)
MAKING ASYNCHRONOUS ASSERTIONS
▸ Eventually()
▸ Consistently()
EVENTUALLY
Eventually(func() []int {
return thing.SliceImMonitoring
}, TIMEOUT, POLLING_INTERVAL).Should(HaveLen(2))
CONSISTENTLY
Consistently(func() []int {
return thing.MemoryUsage()
}).Should(BeNumerically("<", 10))
PROCESS
‣ Connect to the web driver
‣ Create page object
‣ Find / select elements on the page to interact with
‣ Interact (click, fill in text, submit form, …)
‣ Make assertions about the expected result
‣ Destroy page object
CONNECTING TO THE WEB DRIVER
var err error
capabilities :=
agouti.NewCapabilities().Browser("firefox").Platform("linux").
With("javascriptEnabled")
page, err = agouti.NewPage("http://selenium:4444/wd/
hub", agouti.Desired(capabilities))
Expect(err).NotTo(HaveOccurred())
page.Size(1360, 768)
FINDING ELEMENTS
‣ page.First(“#project-toggle")
‣ page.FindByLabel(“Password")
MORE FINDERS
‣ FindByButton(text string) *Selection
‣ FindByLabel(text string) *Selection
‣ FindByLink(text string) *Selection
‣ FindByName(name string) *Selection
‣ FindByXPath(selector string) *Selection
‣ and many more…
THINGS TO DO WITH THE PAGE
‣ GetCookies() ([]*http.Cookie, error)
‣ Navigate(url string) error
‣ RunScript(body string, arguments map[string]interface{},
result interface{}) error
‣ Screenshot(filename string) error
‣ SetCookie(cookie *http.Cookie) error
‣ Size(width, height int) error
‣ and so on…
THINGS TO DO WITH THE SELECTION
‣ Check() error
‣ Click() error
‣ Fill(text string) error
‣ Submit() error
‣ UploadFile(filename string) error
‣ FlickFinger(xOffset, yOffset int, speed uint) error
‣ and so on…
OUR SETUP
DOCKER COMPOSE
SELENIUM
HEADLESS FIREFOX
GO RUNTIME
LIBRARIES
TEST SUITE
CAMATO
ENVIRONMENT VARIABLES
‣ ENV: {staging, review, integration, www}
‣ which server to test against
‣ SCREENSHOT: {yes, no}
‣ whether or not to record screenshots
IN DOCKER-COMPOSE.YML
kitten:
<<: *smoketests
command: go test -test.timeout 15m -ginkgo.progress -ginkgo.v -
ginkgo.focus Kitten
campaign_management:
<<: *smoketests
command: go test -test.timeout 15m -ginkgo.progress -ginkgo.v -
ginkgo.focus Campaign
FROM THE COMMAND LINE
docker-compose run -e ENV=staging -e SCREENSHOT=yes all
docker-compose run -e ENV=staging -e SCREENSHOT=yes kitten
docker-compose run -e ENV=staging -e SCREENSHOT=yes campaign_management
DEMO
THANKS!

Weitere ähnliche Inhalte

Was ist angesagt?

Removing performance bottlenecks with Kafka Monitoring and topic configuration
Removing performance bottlenecks with Kafka Monitoring and topic configurationRemoving performance bottlenecks with Kafka Monitoring and topic configuration
Removing performance bottlenecks with Kafka Monitoring and topic configurationKnoldus Inc.
 
MikroTik & RouterOS
MikroTik & RouterOSMikroTik & RouterOS
MikroTik & RouterOSFaelix Ltd
 
LinuxCon 2015 Linux Kernel Networking Walkthrough
LinuxCon 2015 Linux Kernel Networking WalkthroughLinuxCon 2015 Linux Kernel Networking Walkthrough
LinuxCon 2015 Linux Kernel Networking WalkthroughThomas Graf
 
Lambdas and Streams Master Class Part 2
Lambdas and Streams Master Class Part 2Lambdas and Streams Master Class Part 2
Lambdas and Streams Master Class Part 2José Paumard
 
Linux Networking Explained
Linux Networking ExplainedLinux Networking Explained
Linux Networking ExplainedThomas Graf
 
Architecture Sustaining LINE Sticker services
Architecture Sustaining LINE Sticker servicesArchitecture Sustaining LINE Sticker services
Architecture Sustaining LINE Sticker servicesLINE Corporation
 
Distributed load testing with k6
Distributed load testing with k6Distributed load testing with k6
Distributed load testing with k6Thijs Feryn
 
[135] 오픈소스 데이터베이스, 은행 서비스에 첫발을 내밀다.
[135] 오픈소스 데이터베이스, 은행 서비스에 첫발을 내밀다.[135] 오픈소스 데이터베이스, 은행 서비스에 첫발을 내밀다.
[135] 오픈소스 데이터베이스, 은행 서비스에 첫발을 내밀다.NAVER D2
 
Openstack Summit Vancouver 2018 - Multicloud Networking
Openstack Summit Vancouver 2018 - Multicloud NetworkingOpenstack Summit Vancouver 2018 - Multicloud Networking
Openstack Summit Vancouver 2018 - Multicloud NetworkingShannon McFarland
 
FreeIPA - Attacking the Active Directory of Linux
FreeIPA - Attacking the Active Directory of LinuxFreeIPA - Attacking the Active Directory of Linux
FreeIPA - Attacking the Active Directory of LinuxJulian Catrambone
 
H3 2011 파이썬으로 클라우드 하고 싶어요_분산기술Lab_하용호
H3 2011 파이썬으로 클라우드 하고 싶어요_분산기술Lab_하용호H3 2011 파이썬으로 클라우드 하고 싶어요_분산기술Lab_하용호
H3 2011 파이썬으로 클라우드 하고 싶어요_분산기술Lab_하용호KTH, 케이티하이텔
 
The Next Generation Firewall for Red Hat Enterprise Linux 7 RC
The Next Generation Firewall for Red Hat Enterprise Linux 7 RCThe Next Generation Firewall for Red Hat Enterprise Linux 7 RC
The Next Generation Firewall for Red Hat Enterprise Linux 7 RCThomas Graf
 
Packet Walk(s) In Kubernetes
Packet Walk(s) In KubernetesPacket Walk(s) In Kubernetes
Packet Walk(s) In KubernetesDon Jayakody
 
Understanding Open vSwitch
Understanding Open vSwitch Understanding Open vSwitch
Understanding Open vSwitch YongKi Kim
 
VXLAN and FRRouting
VXLAN and FRRoutingVXLAN and FRRouting
VXLAN and FRRoutingFaisal Reza
 
GraphConnect 2022 - Top 10 Cypher Tuning Tips & Tricks.pptx
GraphConnect 2022 - Top 10 Cypher Tuning Tips & Tricks.pptxGraphConnect 2022 - Top 10 Cypher Tuning Tips & Tricks.pptx
GraphConnect 2022 - Top 10 Cypher Tuning Tips & Tricks.pptxjexp
 
Going native with less coupling: Dependency Injection in C++
Going native with less coupling: Dependency Injection in C++Going native with less coupling: Dependency Injection in C++
Going native with less coupling: Dependency Injection in C++Daniele Pallastrelli
 
Mikrotik IP Settings For Performance and Security
Mikrotik IP Settings For Performance and SecurityMikrotik IP Settings For Performance and Security
Mikrotik IP Settings For Performance and SecurityGLC Networks
 

Was ist angesagt? (20)

Removing performance bottlenecks with Kafka Monitoring and topic configuration
Removing performance bottlenecks with Kafka Monitoring and topic configurationRemoving performance bottlenecks with Kafka Monitoring and topic configuration
Removing performance bottlenecks with Kafka Monitoring and topic configuration
 
MikroTik & RouterOS
MikroTik & RouterOSMikroTik & RouterOS
MikroTik & RouterOS
 
LinuxCon 2015 Linux Kernel Networking Walkthrough
LinuxCon 2015 Linux Kernel Networking WalkthroughLinuxCon 2015 Linux Kernel Networking Walkthrough
LinuxCon 2015 Linux Kernel Networking Walkthrough
 
Lambdas and Streams Master Class Part 2
Lambdas and Streams Master Class Part 2Lambdas and Streams Master Class Part 2
Lambdas and Streams Master Class Part 2
 
Linux Networking Explained
Linux Networking ExplainedLinux Networking Explained
Linux Networking Explained
 
Architecture Sustaining LINE Sticker services
Architecture Sustaining LINE Sticker servicesArchitecture Sustaining LINE Sticker services
Architecture Sustaining LINE Sticker services
 
Distributed load testing with k6
Distributed load testing with k6Distributed load testing with k6
Distributed load testing with k6
 
[135] 오픈소스 데이터베이스, 은행 서비스에 첫발을 내밀다.
[135] 오픈소스 데이터베이스, 은행 서비스에 첫발을 내밀다.[135] 오픈소스 데이터베이스, 은행 서비스에 첫발을 내밀다.
[135] 오픈소스 데이터베이스, 은행 서비스에 첫발을 내밀다.
 
Openstack Summit Vancouver 2018 - Multicloud Networking
Openstack Summit Vancouver 2018 - Multicloud NetworkingOpenstack Summit Vancouver 2018 - Multicloud Networking
Openstack Summit Vancouver 2018 - Multicloud Networking
 
FreeIPA - Attacking the Active Directory of Linux
FreeIPA - Attacking the Active Directory of LinuxFreeIPA - Attacking the Active Directory of Linux
FreeIPA - Attacking the Active Directory of Linux
 
H3 2011 파이썬으로 클라우드 하고 싶어요_분산기술Lab_하용호
H3 2011 파이썬으로 클라우드 하고 싶어요_분산기술Lab_하용호H3 2011 파이썬으로 클라우드 하고 싶어요_분산기술Lab_하용호
H3 2011 파이썬으로 클라우드 하고 싶어요_분산기술Lab_하용호
 
The Next Generation Firewall for Red Hat Enterprise Linux 7 RC
The Next Generation Firewall for Red Hat Enterprise Linux 7 RCThe Next Generation Firewall for Red Hat Enterprise Linux 7 RC
The Next Generation Firewall for Red Hat Enterprise Linux 7 RC
 
Packet Walk(s) In Kubernetes
Packet Walk(s) In KubernetesPacket Walk(s) In Kubernetes
Packet Walk(s) In Kubernetes
 
Understanding Open vSwitch
Understanding Open vSwitch Understanding Open vSwitch
Understanding Open vSwitch
 
VXLAN and FRRouting
VXLAN and FRRoutingVXLAN and FRRouting
VXLAN and FRRouting
 
GraphConnect 2022 - Top 10 Cypher Tuning Tips & Tricks.pptx
GraphConnect 2022 - Top 10 Cypher Tuning Tips & Tricks.pptxGraphConnect 2022 - Top 10 Cypher Tuning Tips & Tricks.pptx
GraphConnect 2022 - Top 10 Cypher Tuning Tips & Tricks.pptx
 
Going native with less coupling: Dependency Injection in C++
Going native with less coupling: Dependency Injection in C++Going native with less coupling: Dependency Injection in C++
Going native with less coupling: Dependency Injection in C++
 
Gremlin's Anatomy
Gremlin's AnatomyGremlin's Anatomy
Gremlin's Anatomy
 
Mikrotik IP Settings For Performance and Security
Mikrotik IP Settings For Performance and SecurityMikrotik IP Settings For Performance and Security
Mikrotik IP Settings For Performance and Security
 
VLAN vs VXLAN
VLAN vs VXLANVLAN vs VXLAN
VLAN vs VXLAN
 

Andere mochten auch

Smoke Testing
Smoke TestingSmoke Testing
Smoke TestingKanoah
 
Smoke testing a_necessary_evil!
Smoke testing a_necessary_evil!Smoke testing a_necessary_evil!
Smoke testing a_necessary_evil!bharanisram
 
Flowtown case study for #sllconf
Flowtown case study for #sllconf Flowtown case study for #sllconf
Flowtown case study for #sllconf Eric Ries
 
Testing types (simple)1
Testing types (simple)1Testing types (simple)1
Testing types (simple)1Nataly Chill
 
Test Driven Development
Test Driven Development Test Driven Development
Test Driven Development Nezir Yürekli
 
Prototyping and Usability Testing your designs
Prototyping and Usability Testing your designsPrototyping and Usability Testing your designs
Prototyping and Usability Testing your designsElizabeth Snowdon
 
Guerilla Usability Testing
Guerilla Usability TestingGuerilla Usability Testing
Guerilla Usability TestingAndy Budd
 
Activity Diagram
Activity DiagramActivity Diagram
Activity DiagramAshesh R
 

Andere mochten auch (12)

Smoke testing
Smoke testingSmoke testing
Smoke testing
 
Smoke Testing: Test Your App or Website
Smoke Testing: Test Your App or WebsiteSmoke Testing: Test Your App or Website
Smoke Testing: Test Your App or Website
 
Smoke Testing
Smoke TestingSmoke Testing
Smoke Testing
 
Smoke testing a_necessary_evil!
Smoke testing a_necessary_evil!Smoke testing a_necessary_evil!
Smoke testing a_necessary_evil!
 
Flowtown case study for #sllconf
Flowtown case study for #sllconf Flowtown case study for #sllconf
Flowtown case study for #sllconf
 
What is smoke testing
What is smoke testingWhat is smoke testing
What is smoke testing
 
Testing types (simple)1
Testing types (simple)1Testing types (simple)1
Testing types (simple)1
 
Test Driven Development
Test Driven Development Test Driven Development
Test Driven Development
 
How to Run a Smoke Test
How to Run a Smoke TestHow to Run a Smoke Test
How to Run a Smoke Test
 
Prototyping and Usability Testing your designs
Prototyping and Usability Testing your designsPrototyping and Usability Testing your designs
Prototyping and Usability Testing your designs
 
Guerilla Usability Testing
Guerilla Usability TestingGuerilla Usability Testing
Guerilla Usability Testing
 
Activity Diagram
Activity DiagramActivity Diagram
Activity Diagram
 

Ähnlich wie Smoke testing with Go

Revolution or Evolution in Page Object
Revolution or Evolution in Page ObjectRevolution or Evolution in Page Object
Revolution or Evolution in Page ObjectArtem Sokovets
 
Google Back To Front: From Gears to App Engine and Beyond
Google Back To Front: From Gears to App Engine and BeyondGoogle Back To Front: From Gears to App Engine and Beyond
Google Back To Front: From Gears to App Engine and Beyonddion
 
Beyond Cookies, Persistent Storage For Web Applications Web Directions North ...
Beyond Cookies, Persistent Storage For Web Applications Web Directions North ...Beyond Cookies, Persistent Storage For Web Applications Web Directions North ...
Beyond Cookies, Persistent Storage For Web Applications Web Directions North ...BradNeuberg
 
Testing for fun in production Into The Box 2018
Testing for fun in production Into The Box 2018Testing for fun in production Into The Box 2018
Testing for fun in production Into The Box 2018Ortus Solutions, Corp
 
Kiss PageObjects [01-2017]
Kiss PageObjects [01-2017]Kiss PageObjects [01-2017]
Kiss PageObjects [01-2017]Iakiv Kramarenko
 
Javascript first-class citizenery
Javascript first-class citizeneryJavascript first-class citizenery
Javascript first-class citizenerytoddbr
 
Everything is Awesome - Cutting the Corners off the Web
Everything is Awesome - Cutting the Corners off the WebEverything is Awesome - Cutting the Corners off the Web
Everything is Awesome - Cutting the Corners off the WebJames Rakich
 
Testing ASP.NET - Progressive.NET
Testing ASP.NET - Progressive.NETTesting ASP.NET - Progressive.NET
Testing ASP.NET - Progressive.NETBen Hall
 
Andriy Shalaenko - GO security tips
Andriy Shalaenko - GO security tipsAndriy Shalaenko - GO security tips
Andriy Shalaenko - GO security tipsOWASP Kyiv
 
Behaviour driven infrastructure
Behaviour driven infrastructureBehaviour driven infrastructure
Behaviour driven infrastructureLindsay Holmwood
 
Google Play Services Rock
Google Play Services RockGoogle Play Services Rock
Google Play Services RockPeter Friese
 
Agile NCR 2013 - Gaurav Bansal- web_automation
Agile NCR 2013 - Gaurav Bansal- web_automationAgile NCR 2013 - Gaurav Bansal- web_automation
Agile NCR 2013 - Gaurav Bansal- web_automationAgileNCR2013
 
Scripting Oracle Develop 2007
Scripting Oracle Develop 2007Scripting Oracle Develop 2007
Scripting Oracle Develop 2007Tugdual Grall
 
Spicy javascript: Create your first Chrome extension for web analytics QA
Spicy javascript: Create your first Chrome extension for web analytics QASpicy javascript: Create your first Chrome extension for web analytics QA
Spicy javascript: Create your first Chrome extension for web analytics QAAlban Gérôme
 
jOOQ at Topconf 2013
jOOQ at Topconf 2013jOOQ at Topconf 2013
jOOQ at Topconf 2013Lukas Eder
 
Future of Web Apps: Google Gears
Future of Web Apps: Google GearsFuture of Web Apps: Google Gears
Future of Web Apps: Google Gearsdion
 
Coroutines talk ppt
Coroutines talk pptCoroutines talk ppt
Coroutines talk pptShahroz Khan
 

Ähnlich wie Smoke testing with Go (20)

Revolution or Evolution in Page Object
Revolution or Evolution in Page ObjectRevolution or Evolution in Page Object
Revolution or Evolution in Page Object
 
Nativescript angular
Nativescript angularNativescript angular
Nativescript angular
 
mobl
moblmobl
mobl
 
Google Back To Front: From Gears to App Engine and Beyond
Google Back To Front: From Gears to App Engine and BeyondGoogle Back To Front: From Gears to App Engine and Beyond
Google Back To Front: From Gears to App Engine and Beyond
 
Beyond Cookies, Persistent Storage For Web Applications Web Directions North ...
Beyond Cookies, Persistent Storage For Web Applications Web Directions North ...Beyond Cookies, Persistent Storage For Web Applications Web Directions North ...
Beyond Cookies, Persistent Storage For Web Applications Web Directions North ...
 
Testing for fun in production Into The Box 2018
Testing for fun in production Into The Box 2018Testing for fun in production Into The Box 2018
Testing for fun in production Into The Box 2018
 
Kiss PageObjects [01-2017]
Kiss PageObjects [01-2017]Kiss PageObjects [01-2017]
Kiss PageObjects [01-2017]
 
Javascript first-class citizenery
Javascript first-class citizeneryJavascript first-class citizenery
Javascript first-class citizenery
 
Everything is Awesome - Cutting the Corners off the Web
Everything is Awesome - Cutting the Corners off the WebEverything is Awesome - Cutting the Corners off the Web
Everything is Awesome - Cutting the Corners off the Web
 
Testing ASP.NET - Progressive.NET
Testing ASP.NET - Progressive.NETTesting ASP.NET - Progressive.NET
Testing ASP.NET - Progressive.NET
 
Andriy Shalaenko - GO security tips
Andriy Shalaenko - GO security tipsAndriy Shalaenko - GO security tips
Andriy Shalaenko - GO security tips
 
Behaviour driven infrastructure
Behaviour driven infrastructureBehaviour driven infrastructure
Behaviour driven infrastructure
 
Google Play Services Rock
Google Play Services RockGoogle Play Services Rock
Google Play Services Rock
 
Agile NCR 2013 - Gaurav Bansal- web_automation
Agile NCR 2013 - Gaurav Bansal- web_automationAgile NCR 2013 - Gaurav Bansal- web_automation
Agile NCR 2013 - Gaurav Bansal- web_automation
 
Scripting Oracle Develop 2007
Scripting Oracle Develop 2007Scripting Oracle Develop 2007
Scripting Oracle Develop 2007
 
Spicy javascript: Create your first Chrome extension for web analytics QA
Spicy javascript: Create your first Chrome extension for web analytics QASpicy javascript: Create your first Chrome extension for web analytics QA
Spicy javascript: Create your first Chrome extension for web analytics QA
 
dojo.Patterns
dojo.Patternsdojo.Patterns
dojo.Patterns
 
jOOQ at Topconf 2013
jOOQ at Topconf 2013jOOQ at Topconf 2013
jOOQ at Topconf 2013
 
Future of Web Apps: Google Gears
Future of Web Apps: Google GearsFuture of Web Apps: Google Gears
Future of Web Apps: Google Gears
 
Coroutines talk ppt
Coroutines talk pptCoroutines talk ppt
Coroutines talk ppt
 

Smoke testing with Go