SlideShare a Scribd company logo
1
CircleCI + Cypress Orbs:
Set up faster, easier, end-to-end testing with CircleCI and Cypress
Vinny Thanh
Solutions Engineer, CircleCI
Gleb Bahmutov
VP of Engineering, Cypress
2
Agenda
1. Introductions
2. Intro to CircleCI & Orbs
3. Cypress Product Overview
4. Cypress + CircleCI Orbs
5. Q&A
Gleb Bahmutov
VP of Engineering, Cypress
Vinny Thanh
Solutions Engineer, CircleCI
Our mission is to make it as easy as
possible to go from idea to delivery.
Intro to CircleCI
● Founded in 2011, now at 300+ employees across 5 continents
● We help teams build better software, quicker, more reliably
● We’re currently the world’s largest shared CI/CD platform
● Built for the Cloud - 1M+ builds per day run on our platform
Where CircleCI sits in the toolchain:
Future support: VCS-Agnosticism
CREATION ORCHESTRATION LOGISTICS
Collaborate Deliver Run
Source Control Build • Test • Deliver Monitor • Operate
CODE COMMIT SHIP TO PRODUCTION
...and more+ various partners & integrations
Quick Demo
How CircleCI Uses Cypress
...
steps:
- restore_cache:
keys:
- v1-dependency-cypress-{{ checksum "yarn.lock" }}
- v1-dependency-cypress
...
- save_cache:
key: v1-dependency-cypress-{{ checksum "yarn.lock" }}
paths:
- /home/circleci/.cache/Cypress
...
- run: yarn test:e2e:run
- store_artifacts:
path: cypress/videos
How CircleCI Uses Cypress (cont’d)
How CircleCI Uses Cypress (cont’d)
11
12
13
Existing Integrations
Partner orbs CircleCI orbs
CircleCI Orbs: 58 Partner Orbs: 81 Total Community Orbs: 1600+
14
Blog posts, documentation, and more:
○ Main Orbs Splash Page: circleci.com/orbs
○ Orb Intro Docs: circleci.com/docs/2.0/orb-intro
○ Orb Creation Docs: circleci.com/docs/2.0/creating-orbs
○ Orb Usage Docs: circleci.com/docs/2.0/using-orbs
○ Reusable Config: circleci.com/docs/2.0/reusing-config
○ Orbs Blog Posts: circleci.com/blog/tag/orbs
Or, dive right in:
○ CircleCI Hello World: circleci.com/docs/2.0/hello-world/
○ Config: circleci.com/docs/2.0/configuration-reference/
○ Orb Registry: circleci.com/orbs/registry
○ GitHub Topic: github.com/topics/circleci-orbs (use it!)
Get support:
○ Ask the community: discuss.circleci.com/c/orbs
○ Talk to support: support.circleci.com/hc/requests/new
○ Become a CircleCI Technology Partner:
circleci.com/partners/technology
Links, resources,
examples, etc.
15
Agenda
1. Cypress + CircleCI Orbs
a. Typical tests and running on CI
b. Orb history and features
c. Comparison to other tools
2. Q&A
16
Fast, easy and reliable testing for anything
that runs in a browser.
$ npm install cypress
https://github.com/cypress-io/cypress MIT License
17
Fast, easy and reliable testing
… on CI ?!
$ npx cypress open
$ npx cypress run
What about installing OS and NPM dependencies (and
caching them), and passing options, and running containers in
parallel?!
Loooong list of examples at
https://on.cypress.io/ci
Run Cypress tests on CI
Run Cypress interactively
18
👏 Cypress Orb 👏 Let us, the tool’s authors
write CI configuration for running it.
19
👏 Cypress Orb 👏 Let us, the tool’s authors
write CI configuration for running it.
https://slides.com/bahmutov/circleci-cypress-orb
https://www.youtube.com/watch?time_continue=59&v=J-xbNtKgXfY
20
https://circleci.com/orbs/registry/orb/cypress-io/cypress
21
tip: use CircleCI CLI tool
New features
New executors
Bug fixes
22
Lessons learned: put a useful example first
My opinion: the above config should
cover 90% of use cases
https://github.com/cypress-io/circleci-orb
23
The effective config
$ circleci config process circle.yml
https://github.com/cypress-io/circleci-orb
24
Lessons learned: show common cases
1. Useful example right away
2. Useful example with
parameter
3. A common complex
example (install in 1 job,
then run 3 parallel test
jobs)
https://github.com/cypress-io/circleci-orb
25
Static config check
version: 2.1
orbs:
cypress: cypress-io/cypress@1
workflows:
build:
jobs:
- cypress/run:
recording: true
$ circleci config validate circle.yml
I want to record results to Cypress Dashboard
$ circleci config validate circle.yml
Error: Error calling workflow: 'build'
Error calling job: 'cypress/run'
Unexpected argument(s): recording
26
Look at the Orb’s documentation
Ohhh, it is “record: true”!
27
Cypress Dashboard
# set CYPRESS_RECORD_KEY
# in CircleCI environment
# or security context 👏
- cypress/run:
record: true
https://on.cypress.io/dashboard-introduction
28
Cypress Dashboard: parallelization
- cypress/install:
build: 'npm run build'
- cypress/run:
requires:
- cypress/install
record: true
parallel: true
parallelism: 4
https://on.cypress.io/parallelization
29
Cypress Dashboard: parallelization
- cypress/install:
build: 'npm run build'
- cypress/run:
requires:
- cypress/install
record: true
parallel: true
parallelism: 15
https://on.cypress.io/parallelization
30
Examples, examples,
examples
…, examples, examples,
examples, and a couple
more examples
Lessons learned: write more examples
31
Lessons learned: write more examples
https://github.com/cypress-io/circleci-orb/blob/master/src/orb.yml
All examples are in the source of
the orb
We process each example to
validate its config
32
Lessons learned: write recipes
Longer than examples to
show real-world use
https://github.com/cypress-io/circleci-orb/blob/master/docs/recipes.md
33
Tip: store test artifacts on Circle
version: 2.1
orbs:
cypress: cypress-io/cypress@1
workflows:
build:
jobs:
- cypress/run:
store_artifacts: true
Store Cypress error screenshots and test run videos on CircleCI
https://github.com/cypress-io/circleci-orb/blob/master/docs/examples.md#artifacts
34
Tip: store test artifacts on Circle
version: 2.1
orbs:
cypress: cypress-io/cypress@1
workflows:
build:
jobs:
- cypress/run:
yarn: true
command: yarn test:e2e:run
store_artifacts: true
...
steps:
- restore_cache:
keys:
- v1-dependency-cypress-{{ checksum "yarn.lock" }}
- v1-dependency-cypress
...
- save_cache:
key: v1-dependency-cypress-{{ checksum "yarn.lock" }}
paths:
- /home/circleci/.cache/Cypress
...
- run: yarn test:e2e:run
- store_artifacts:
path: cypress/videos
Remember “How CircleCI Uses
Cypress”?
Equivalent entire config
35
version: 2.1
orbs:
cypress: cypress-io/cypress@1
workflows:
build:
jobs:
- cypress/run:
post-steps:
- store_artifacts:
path: mochawesome-report
Store any artifacts on Circle
Store custom test reports
https://github.com/cypress-io/circleci-orb/blob/master/docs/examples.md#any-artifacts
36
version: 2.1
orbs:
cypress: cypress-io/cypress@1
workflows:
build:
jobs:
- cypress/run:
name: full tests
start: npm start
command: NODE_ENV=test npm run cypress:run
post-steps:
# store the created coverage report folder
# you can click on it in the CircleCI UI
# to see live static HTML site
- store_artifacts:
path: coverage
Store code coverage reports on Circle!
https://github.com/cypress-io/cypress-example-todomvc-redux
37
Store code coverage reports on Circle!
https://circleci.com/gh/cypress-io/cypress-example-todomvc-redux/
38
Store code coverage reports on Circle!
https://circleci.com/gh/cypress-io/cypress-example-todomvc-redux/
39
CircleCI workflow link in Cypress Dashboard
40
https://circleci.com/gh/cypress-io/workflows/cypress/tree/develop
Is built mostly on CircleCI
Windows builds (32 and 64) are moving to Circle too
41
https://circleci.com/gh/cypress-io/workflows/cypress/tree/develop
Is built mostly on CircleCI
Even more - each build kicks off test projects that
report back via status checks
42
Is built mostly on CircleCI
We 💝 Circle workflow 2.1 syntax
Commands ❤
Jobs ❤
Orbs ❤
Executors are ok
https://github.com/cypress-io/cypress-test-node-versions/blob/master/circle.yml
43
Cypress Orb vs Others
Cypress CircleCI Orb Cypress GitHub Action Cypress Netlify Plugin
Caching and test
execution
✅ ✅ ✅
Single line config ✅ − ✅
Total parameters 23 17 4
Control number of
parallel containers
✅ − −
Separate install
and test jobs
✅ ✅ −
Validate config ✅ − −
Repository cypress-io/circleci-orb cypress-io/github-action cypress-io/netlify-plugin-cypress
44
Conclusions
Run full end-to-end tests in a real browser
on your CI with a single line
version: 2.1
orbs:
cypress: cypress-io/cypress@1
workflows:
build:
jobs:
- cypress/run
45
Thank you!
Time for Q&A
46
Contact us with questions!
marketing-tech@circleci.com
https://link.cypress.io/circle
Fill out this survey and get a free Cypress T-Shirt
gleb@cypress.io
@bahmutov

More Related Content

What's hot

What's hot (14)

Open Source CMS, MDD, TDD: Pros and Cons
Open Source CMS, MDD, TDD:  Pros and ConsOpen Source CMS, MDD, TDD:  Pros and Cons
Open Source CMS, MDD, TDD: Pros and Cons
 
Container sig#1 ansible-container
Container sig#1 ansible-containerContainer sig#1 ansible-container
Container sig#1 ansible-container
 
CI、CD、Automation你還沒準備好!?(Agile Tour Kaohsiung 2017)
CI、CD、Automation你還沒準備好!?(Agile Tour Kaohsiung 2017)CI、CD、Automation你還沒準備好!?(Agile Tour Kaohsiung 2017)
CI、CD、Automation你還沒準備好!?(Agile Tour Kaohsiung 2017)
 
The story of language development
The story of language developmentThe story of language development
The story of language development
 
Patterns and antipatterns in Docker image lifecycle as was presented at Globa...
Patterns and antipatterns in Docker image lifecycle as was presented at Globa...Patterns and antipatterns in Docker image lifecycle as was presented at Globa...
Patterns and antipatterns in Docker image lifecycle as was presented at Globa...
 
20150317 firefox os_studymtg_engver
20150317 firefox os_studymtg_engver20150317 firefox os_studymtg_engver
20150317 firefox os_studymtg_engver
 
CI : the first_step: Auto Testing with CircleCI - (MOSG)
CI : the first_step: Auto Testing with CircleCI - (MOSG)CI : the first_step: Auto Testing with CircleCI - (MOSG)
CI : the first_step: Auto Testing with CircleCI - (MOSG)
 
DevOpsDays Taipei 2017 Opening Talk
DevOpsDays Taipei 2017 Opening TalkDevOpsDays Taipei 2017 Opening Talk
DevOpsDays Taipei 2017 Opening Talk
 
How to create your own hack environment
How to create your own hack environmentHow to create your own hack environment
How to create your own hack environment
 
DCSF 19 Deploying Rootless buildkit on Kubernetes
DCSF 19 Deploying Rootless buildkit on KubernetesDCSF 19 Deploying Rootless buildkit on Kubernetes
DCSF 19 Deploying Rootless buildkit on Kubernetes
 
Patterns and antipatterns in Docker image lifecycle as was presented at Devop...
Patterns and antipatterns in Docker image lifecycle as was presented at Devop...Patterns and antipatterns in Docker image lifecycle as was presented at Devop...
Patterns and antipatterns in Docker image lifecycle as was presented at Devop...
 
Ansible Workshop for Pythonistas
Ansible Workshop for PythonistasAnsible Workshop for Pythonistas
Ansible Workshop for Pythonistas
 
Docker to the Rescue of an Ops Team
Docker to the Rescue of an Ops TeamDocker to the Rescue of an Ops Team
Docker to the Rescue of an Ops Team
 
Beachhead implements new opcode on CLR JIT
Beachhead implements new opcode on CLR JITBeachhead implements new opcode on CLR JIT
Beachhead implements new opcode on CLR JIT
 

Similar to Set up faster, easier, end-to-end testing with CircleCI and Cypress

OpenShift-Build-Pipelines: Build -> Test -> Run! @JavaForumStuttgart
OpenShift-Build-Pipelines: Build -> Test -> Run! @JavaForumStuttgartOpenShift-Build-Pipelines: Build -> Test -> Run! @JavaForumStuttgart
OpenShift-Build-Pipelines: Build -> Test -> Run! @JavaForumStuttgart
Tobias Schneck
 
Continuous delivery applied
Continuous delivery appliedContinuous delivery applied
Continuous delivery applied
Mike McGarr
 

Similar to Set up faster, easier, end-to-end testing with CircleCI and Cypress (20)

OpenShift-Build-Pipelines: Build -> Test -> Run! @JavaForumStuttgart
OpenShift-Build-Pipelines: Build -> Test -> Run! @JavaForumStuttgartOpenShift-Build-Pipelines: Build -> Test -> Run! @JavaForumStuttgart
OpenShift-Build-Pipelines: Build -> Test -> Run! @JavaForumStuttgart
 
How to improve CI CD for any Node.js application
How to improve CI CD for any Node.js applicationHow to improve CI CD for any Node.js application
How to improve CI CD for any Node.js application
 
OpenShift Build Pipelines @ Lightweight Java User Group Meetup
OpenShift Build Pipelines @ Lightweight Java User Group MeetupOpenShift Build Pipelines @ Lightweight Java User Group Meetup
OpenShift Build Pipelines @ Lightweight Java User Group Meetup
 
Clojure Conj 2014 - Paradigms of core.async - Julian Gamble
Clojure Conj 2014 - Paradigms of core.async - Julian GambleClojure Conj 2014 - Paradigms of core.async - Julian Gamble
Clojure Conj 2014 - Paradigms of core.async - Julian Gamble
 
DevOps with Serverless
DevOps with ServerlessDevOps with Serverless
DevOps with Serverless
 
PVS-Studio in the Clouds: CircleCI
PVS-Studio in the Clouds: CircleCIPVS-Studio in the Clouds: CircleCI
PVS-Studio in the Clouds: CircleCI
 
Qcon beijing 2010
Qcon beijing 2010Qcon beijing 2010
Qcon beijing 2010
 
Ci for i-os-codemash-01.2013
Ci for i-os-codemash-01.2013Ci for i-os-codemash-01.2013
Ci for i-os-codemash-01.2013
 
Is your kubernetes negative or positive
Is your kubernetes negative or positive Is your kubernetes negative or positive
Is your kubernetes negative or positive
 
20171122 aws usergrp_coretech-spn-cicd-aws-v01
20171122 aws usergrp_coretech-spn-cicd-aws-v0120171122 aws usergrp_coretech-spn-cicd-aws-v01
20171122 aws usergrp_coretech-spn-cicd-aws-v01
 
Flux’s Security & Scalability with OCI & Helm Slides.pdf
Flux’s Security & Scalability with OCI & Helm Slides.pdfFlux’s Security & Scalability with OCI & Helm Slides.pdf
Flux’s Security & Scalability with OCI & Helm Slides.pdf
 
CI/CD for React Native
CI/CD for React NativeCI/CD for React Native
CI/CD for React Native
 
Continuous delivery applied
Continuous delivery appliedContinuous delivery applied
Continuous delivery applied
 
Mihai Criveti - PyCon Ireland - Automate Everything
Mihai Criveti - PyCon Ireland - Automate EverythingMihai Criveti - PyCon Ireland - Automate Everything
Mihai Criveti - PyCon Ireland - Automate Everything
 
Navigating container technology for enhanced security by Niklas Saari
Navigating container technology for enhanced security by Niklas SaariNavigating container technology for enhanced security by Niklas Saari
Navigating container technology for enhanced security by Niklas Saari
 
Continuous delivery applied (DC CI User Group)
Continuous delivery applied (DC CI User Group)Continuous delivery applied (DC CI User Group)
Continuous delivery applied (DC CI User Group)
 
DCEU 18: Building Your Development Pipeline
DCEU 18: Building Your Development PipelineDCEU 18: Building Your Development Pipeline
DCEU 18: Building Your Development Pipeline
 
Jenkins-CI
Jenkins-CIJenkins-CI
Jenkins-CI
 
Containerizing a REST API and Deploying to Kubernetes
Containerizing a REST API and Deploying to KubernetesContainerizing a REST API and Deploying to Kubernetes
Containerizing a REST API and Deploying to Kubernetes
 
apidays LIVE Paris 2021 - APIGEE, different ways for integrating with CI/CD p...
apidays LIVE Paris 2021 - APIGEE, different ways for integrating with CI/CD p...apidays LIVE Paris 2021 - APIGEE, different ways for integrating with CI/CD p...
apidays LIVE Paris 2021 - APIGEE, different ways for integrating with CI/CD p...
 

Recently uploaded

JustNaik Solution Deck (stage bus sector)
JustNaik Solution Deck (stage bus sector)JustNaik Solution Deck (stage bus sector)
JustNaik Solution Deck (stage bus sector)
Max Lee
 
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
Alluxio, Inc.
 

Recently uploaded (20)

AI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAG
AI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAGAI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAG
AI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAG
 
KLARNA - Language Models and Knowledge Graphs: A Systems Approach
KLARNA -  Language Models and Knowledge Graphs: A Systems ApproachKLARNA -  Language Models and Knowledge Graphs: A Systems Approach
KLARNA - Language Models and Knowledge Graphs: A Systems Approach
 
CompTIA Security+ (Study Notes) for cs.pdf
CompTIA Security+ (Study Notes) for cs.pdfCompTIA Security+ (Study Notes) for cs.pdf
CompTIA Security+ (Study Notes) for cs.pdf
 
how-to-download-files-safely-from-the-internet.pdf
how-to-download-files-safely-from-the-internet.pdfhow-to-download-files-safely-from-the-internet.pdf
how-to-download-files-safely-from-the-internet.pdf
 
Agnieszka Andrzejewska - BIM School Course in Kraków
Agnieszka Andrzejewska - BIM School Course in KrakówAgnieszka Andrzejewska - BIM School Course in Kraków
Agnieszka Andrzejewska - BIM School Course in Kraków
 
A Guideline to Gorgias to to Re:amaze Data Migration
A Guideline to Gorgias to to Re:amaze Data MigrationA Guideline to Gorgias to to Re:amaze Data Migration
A Guideline to Gorgias to to Re:amaze Data Migration
 
JustNaik Solution Deck (stage bus sector)
JustNaik Solution Deck (stage bus sector)JustNaik Solution Deck (stage bus sector)
JustNaik Solution Deck (stage bus sector)
 
How to install and activate eGrabber JobGrabber
How to install and activate eGrabber JobGrabberHow to install and activate eGrabber JobGrabber
How to install and activate eGrabber JobGrabber
 
AI/ML Infra Meetup | Perspective on Deep Learning Framework
AI/ML Infra Meetup | Perspective on Deep Learning FrameworkAI/ML Infra Meetup | Perspective on Deep Learning Framework
AI/ML Infra Meetup | Perspective on Deep Learning Framework
 
Studiovity film pre-production and screenwriting software
Studiovity film pre-production and screenwriting softwareStudiovity film pre-production and screenwriting software
Studiovity film pre-production and screenwriting software
 
IT Software Development Resume, Vaibhav jha 2024
IT Software Development Resume, Vaibhav jha 2024IT Software Development Resume, Vaibhav jha 2024
IT Software Development Resume, Vaibhav jha 2024
 
Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...
Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...
Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...
 
A Comprehensive Appium Guide for Hybrid App Automation Testing.pdf
A Comprehensive Appium Guide for Hybrid App Automation Testing.pdfA Comprehensive Appium Guide for Hybrid App Automation Testing.pdf
A Comprehensive Appium Guide for Hybrid App Automation Testing.pdf
 
Workforce Efficiency with Employee Time Tracking Software.pdf
Workforce Efficiency with Employee Time Tracking Software.pdfWorkforce Efficiency with Employee Time Tracking Software.pdf
Workforce Efficiency with Employee Time Tracking Software.pdf
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
Abortion ^Clinic ^%[+971588192166''] Abortion Pill Al Ain (?@?) Abortion Pill...
Abortion ^Clinic ^%[+971588192166''] Abortion Pill Al Ain (?@?) Abortion Pill...Abortion ^Clinic ^%[+971588192166''] Abortion Pill Al Ain (?@?) Abortion Pill...
Abortion ^Clinic ^%[+971588192166''] Abortion Pill Al Ain (?@?) Abortion Pill...
 
10 Essential Software Testing Tools You Need to Know About.pdf
10 Essential Software Testing Tools You Need to Know About.pdf10 Essential Software Testing Tools You Need to Know About.pdf
10 Essential Software Testing Tools You Need to Know About.pdf
 
INGKA DIGITAL: Linked Metadata by Design
INGKA DIGITAL: Linked Metadata by DesignINGKA DIGITAL: Linked Metadata by Design
INGKA DIGITAL: Linked Metadata by Design
 
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
 
OpenChain @ LF Japan Executive Briefing - May 2024
OpenChain @ LF Japan Executive Briefing - May 2024OpenChain @ LF Japan Executive Briefing - May 2024
OpenChain @ LF Japan Executive Briefing - May 2024
 

Set up faster, easier, end-to-end testing with CircleCI and Cypress

  • 1. 1 CircleCI + Cypress Orbs: Set up faster, easier, end-to-end testing with CircleCI and Cypress Vinny Thanh Solutions Engineer, CircleCI Gleb Bahmutov VP of Engineering, Cypress
  • 2. 2 Agenda 1. Introductions 2. Intro to CircleCI & Orbs 3. Cypress Product Overview 4. Cypress + CircleCI Orbs 5. Q&A
  • 3. Gleb Bahmutov VP of Engineering, Cypress Vinny Thanh Solutions Engineer, CircleCI
  • 4. Our mission is to make it as easy as possible to go from idea to delivery.
  • 5. Intro to CircleCI ● Founded in 2011, now at 300+ employees across 5 continents ● We help teams build better software, quicker, more reliably ● We’re currently the world’s largest shared CI/CD platform ● Built for the Cloud - 1M+ builds per day run on our platform
  • 6. Where CircleCI sits in the toolchain: Future support: VCS-Agnosticism CREATION ORCHESTRATION LOGISTICS Collaborate Deliver Run Source Control Build • Test • Deliver Monitor • Operate CODE COMMIT SHIP TO PRODUCTION ...and more+ various partners & integrations
  • 8. How CircleCI Uses Cypress ... steps: - restore_cache: keys: - v1-dependency-cypress-{{ checksum "yarn.lock" }} - v1-dependency-cypress ... - save_cache: key: v1-dependency-cypress-{{ checksum "yarn.lock" }} paths: - /home/circleci/.cache/Cypress ... - run: yarn test:e2e:run - store_artifacts: path: cypress/videos
  • 9. How CircleCI Uses Cypress (cont’d)
  • 10. How CircleCI Uses Cypress (cont’d)
  • 11. 11
  • 12. 12
  • 13. 13 Existing Integrations Partner orbs CircleCI orbs CircleCI Orbs: 58 Partner Orbs: 81 Total Community Orbs: 1600+
  • 14. 14 Blog posts, documentation, and more: ○ Main Orbs Splash Page: circleci.com/orbs ○ Orb Intro Docs: circleci.com/docs/2.0/orb-intro ○ Orb Creation Docs: circleci.com/docs/2.0/creating-orbs ○ Orb Usage Docs: circleci.com/docs/2.0/using-orbs ○ Reusable Config: circleci.com/docs/2.0/reusing-config ○ Orbs Blog Posts: circleci.com/blog/tag/orbs Or, dive right in: ○ CircleCI Hello World: circleci.com/docs/2.0/hello-world/ ○ Config: circleci.com/docs/2.0/configuration-reference/ ○ Orb Registry: circleci.com/orbs/registry ○ GitHub Topic: github.com/topics/circleci-orbs (use it!) Get support: ○ Ask the community: discuss.circleci.com/c/orbs ○ Talk to support: support.circleci.com/hc/requests/new ○ Become a CircleCI Technology Partner: circleci.com/partners/technology Links, resources, examples, etc.
  • 15. 15 Agenda 1. Cypress + CircleCI Orbs a. Typical tests and running on CI b. Orb history and features c. Comparison to other tools 2. Q&A
  • 16. 16 Fast, easy and reliable testing for anything that runs in a browser. $ npm install cypress https://github.com/cypress-io/cypress MIT License
  • 17. 17 Fast, easy and reliable testing … on CI ?! $ npx cypress open $ npx cypress run What about installing OS and NPM dependencies (and caching them), and passing options, and running containers in parallel?! Loooong list of examples at https://on.cypress.io/ci Run Cypress tests on CI Run Cypress interactively
  • 18. 18 👏 Cypress Orb 👏 Let us, the tool’s authors write CI configuration for running it.
  • 19. 19 👏 Cypress Orb 👏 Let us, the tool’s authors write CI configuration for running it. https://slides.com/bahmutov/circleci-cypress-orb https://www.youtube.com/watch?time_continue=59&v=J-xbNtKgXfY
  • 21. 21 tip: use CircleCI CLI tool New features New executors Bug fixes
  • 22. 22 Lessons learned: put a useful example first My opinion: the above config should cover 90% of use cases https://github.com/cypress-io/circleci-orb
  • 23. 23 The effective config $ circleci config process circle.yml https://github.com/cypress-io/circleci-orb
  • 24. 24 Lessons learned: show common cases 1. Useful example right away 2. Useful example with parameter 3. A common complex example (install in 1 job, then run 3 parallel test jobs) https://github.com/cypress-io/circleci-orb
  • 25. 25 Static config check version: 2.1 orbs: cypress: cypress-io/cypress@1 workflows: build: jobs: - cypress/run: recording: true $ circleci config validate circle.yml I want to record results to Cypress Dashboard $ circleci config validate circle.yml Error: Error calling workflow: 'build' Error calling job: 'cypress/run' Unexpected argument(s): recording
  • 26. 26 Look at the Orb’s documentation Ohhh, it is “record: true”!
  • 27. 27 Cypress Dashboard # set CYPRESS_RECORD_KEY # in CircleCI environment # or security context 👏 - cypress/run: record: true https://on.cypress.io/dashboard-introduction
  • 28. 28 Cypress Dashboard: parallelization - cypress/install: build: 'npm run build' - cypress/run: requires: - cypress/install record: true parallel: true parallelism: 4 https://on.cypress.io/parallelization
  • 29. 29 Cypress Dashboard: parallelization - cypress/install: build: 'npm run build' - cypress/run: requires: - cypress/install record: true parallel: true parallelism: 15 https://on.cypress.io/parallelization
  • 30. 30 Examples, examples, examples …, examples, examples, examples, and a couple more examples Lessons learned: write more examples
  • 31. 31 Lessons learned: write more examples https://github.com/cypress-io/circleci-orb/blob/master/src/orb.yml All examples are in the source of the orb We process each example to validate its config
  • 32. 32 Lessons learned: write recipes Longer than examples to show real-world use https://github.com/cypress-io/circleci-orb/blob/master/docs/recipes.md
  • 33. 33 Tip: store test artifacts on Circle version: 2.1 orbs: cypress: cypress-io/cypress@1 workflows: build: jobs: - cypress/run: store_artifacts: true Store Cypress error screenshots and test run videos on CircleCI https://github.com/cypress-io/circleci-orb/blob/master/docs/examples.md#artifacts
  • 34. 34 Tip: store test artifacts on Circle version: 2.1 orbs: cypress: cypress-io/cypress@1 workflows: build: jobs: - cypress/run: yarn: true command: yarn test:e2e:run store_artifacts: true ... steps: - restore_cache: keys: - v1-dependency-cypress-{{ checksum "yarn.lock" }} - v1-dependency-cypress ... - save_cache: key: v1-dependency-cypress-{{ checksum "yarn.lock" }} paths: - /home/circleci/.cache/Cypress ... - run: yarn test:e2e:run - store_artifacts: path: cypress/videos Remember “How CircleCI Uses Cypress”? Equivalent entire config
  • 35. 35 version: 2.1 orbs: cypress: cypress-io/cypress@1 workflows: build: jobs: - cypress/run: post-steps: - store_artifacts: path: mochawesome-report Store any artifacts on Circle Store custom test reports https://github.com/cypress-io/circleci-orb/blob/master/docs/examples.md#any-artifacts
  • 36. 36 version: 2.1 orbs: cypress: cypress-io/cypress@1 workflows: build: jobs: - cypress/run: name: full tests start: npm start command: NODE_ENV=test npm run cypress:run post-steps: # store the created coverage report folder # you can click on it in the CircleCI UI # to see live static HTML site - store_artifacts: path: coverage Store code coverage reports on Circle! https://github.com/cypress-io/cypress-example-todomvc-redux
  • 37. 37 Store code coverage reports on Circle! https://circleci.com/gh/cypress-io/cypress-example-todomvc-redux/
  • 38. 38 Store code coverage reports on Circle! https://circleci.com/gh/cypress-io/cypress-example-todomvc-redux/
  • 39. 39 CircleCI workflow link in Cypress Dashboard
  • 40. 40 https://circleci.com/gh/cypress-io/workflows/cypress/tree/develop Is built mostly on CircleCI Windows builds (32 and 64) are moving to Circle too
  • 41. 41 https://circleci.com/gh/cypress-io/workflows/cypress/tree/develop Is built mostly on CircleCI Even more - each build kicks off test projects that report back via status checks
  • 42. 42 Is built mostly on CircleCI We 💝 Circle workflow 2.1 syntax Commands ❤ Jobs ❤ Orbs ❤ Executors are ok https://github.com/cypress-io/cypress-test-node-versions/blob/master/circle.yml
  • 43. 43 Cypress Orb vs Others Cypress CircleCI Orb Cypress GitHub Action Cypress Netlify Plugin Caching and test execution ✅ ✅ ✅ Single line config ✅ − ✅ Total parameters 23 17 4 Control number of parallel containers ✅ − − Separate install and test jobs ✅ ✅ − Validate config ✅ − − Repository cypress-io/circleci-orb cypress-io/github-action cypress-io/netlify-plugin-cypress
  • 44. 44 Conclusions Run full end-to-end tests in a real browser on your CI with a single line version: 2.1 orbs: cypress: cypress-io/cypress@1 workflows: build: jobs: - cypress/run
  • 46. 46 Contact us with questions! marketing-tech@circleci.com https://link.cypress.io/circle Fill out this survey and get a free Cypress T-Shirt gleb@cypress.io @bahmutov