Gleb Bahmutov PRO
JavaScript ninja, image processing expert, software quality fanatic
https://lizkeogh.com/2019/07/02/off-the-charts/
+3 degrees Celsius will be the end.
State of the art "technology" - the horse
the bicycle
// WHY DOESN'T THIS WORK!!?
const text = await cy.get('#inner').text
expect(text).to.equal('Submit')
cy.get('#inner')
.should('have.text', 'Submit')
Why?!!! How is this better?!!!
cy.get('#inner')
.should('have.text', 'Submit')
.and('have.css', 'color', 'rgb(255, 0, 0)')
.click()
Makes the tests human
A complex system that works is invariably found to have evolved from a simple system that worked. A complex system designed from scratch never works and cannot be patched up to make it work. You have to start over, beginning with a working simple system.
- John Gall
A complex system that works is invariably found to have evolved from a simple well-documented system that worked.
"Gleb's Law"
Selling the drills and not the holes
Fast, easy and reliable testing for anything that runs in a browser.
Cross-platform e2e test runner
Tell me why I should read it
npm install ...
🙁
Not stating the requirements clearly
This guide assumes you know X and have Y and Z
Open the app and ...
🤔
This is how you drill a hole...
Missing the published date
When was this written?
Is this even relevant?
Missing version numbers
Missing version numbers
If I see a question on a forum, GitHub, Twitter, etc
How do I toggle a checkbox?
App HTML
Test code
Markdown file
Markdown file
Markdown is king
Markdown spec also becomes a static docs page
Every example is scraped into the docs index
Instead, update the documentation, or create an example, or write a blog post.
Then answer with a link
Should eliminate their own jobs by writing more and more documentation until the users find everything themselves
{
"extends": [
"config:base"
],
"automerge": true,
"masterIssue": true
}
renovate.json
name: badges
# update README badge only if the README file changes
# or if the package.json file changes, or this file changes
on:
push:
branches:
- master
paths:
- README.md
- package.json
- .github/workflows/badges.yml
jobs:
build:
name: Badges
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎
uses: actions/checkout@v1
- name: Update version badges 🏷
run: |
npx -p dependency-version-badge update-badge cypress cypress-react-unit-test
# commit any changed files
# https://github.com/mikeal/publish-to-github-action
- name: Push any changes to repo 📤
uses: mikeal/publish-to-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
.github/workflows/badges.yml
Create and embed app screenshots from tests into your documentation
Tests become the status of your project
Thank you 👏
By Gleb Bahmutov
If you are working on the web application, and try to document it for the users, what do you do? Do you copy / paste screenshots into the docs? Does your documentation slowly diverge from the application? What if there was a better way? In this talk, I will show how to use the tests to document the web-application behavior, ensuring the docs are always correct. Presented at CityJS 2021
JavaScript ninja, image processing expert, software quality fanatic